summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2017-09-22 09:52:20 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2017-09-22 09:52:20 -0700
commitb29f5d3bef660a083e077237ffe5e4e47bab7cdb (patch)
tree2e2a0e5d759c461cfdb3746c05d59ba0a74da0fa
parentafc6bd6955f8d8a9f405493dc2ff00b363f55f9c (diff)
parentd7e875ae67c99eaa26ccb92f8c3a802690694356 (diff)
Merge branch 'maint'
-rw-r--r--CMakeLists.txt10
1 files changed, 3 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1f35f5b77..0813ce8157 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,19 +146,15 @@ ELSE()
ENDIF()
IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
- SET(CMAKE_C_STANDARD 99)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
- SET(CMAKE_C_STANDARD 99)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
- SET(CMAKE_C_STANDARD 11)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
ELSE()
message(warning "C standard could not be set because compiler is not GNU, Clang or MSVC.")
ENDIF()
-# if cmake version is < 3.1, explicitly set C standard to use.
-IF(${CMAKE_VERSION} VERSION_LESS "3.1")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c${CMAKE_C_STANDARD}")
-ENDIF()
########################################################################
# Environment setup