aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 9 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 935863f60..c4332e3f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -695,7 +695,8 @@ CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN)
CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES)
CHECK_C_COMPILER_FLAG(-pedantic SUPPORT_PEDANTIC_FLAG)
IF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro)
- CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG)
+ CHECK_C_COMPILER_FLAG("-std=c11" SUPPORT_STD11_FLAG)
+ CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD99_FLAG)
ENDIF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro)
IF(SUPPORT_W)
SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -W")
@@ -724,9 +725,13 @@ ENDIF(SUPPORT_WSTRICT_PROTOTYPES)
IF(SUPPORT_PEDANTIC_FLAG)
SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -pedantic")
ENDIF(SUPPORT_PEDANTIC_FLAG)
-IF(SUPPORT_STD_FLAG)
- SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -std=c99")
-ENDIF(SUPPORT_STD_FLAG)
+IF(SUPPORT_STD11_FLAG)
+ SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -std=c11")
+ELSE(SUPPORT_STD11_FLAG)
+ IF(SUPPORT_STD99_FLAG)
+ SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -std=c99")
+ ENDIF(SUPPORT_STD99_FLAG)
+ENDIF(SUPPORT_STD11_FLAG)
CHECK_C_COMPILER_FLAG(-fPIC SUPPORT_FPIC)
IF(SUPPORT_FPIC)