aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-30 10:55:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-30 10:55:32 +0100
commit56583a05d4f391afc3a7bb1551be9724a6d7ba72 (patch)
tree972d68ad0bdf70a96b3cced15f31bc86ad7745df /CMakeLists.txt
parent78f34e1a2f7fc6a0587516079db0504c3ddccfa8 (diff)
downloadrspamd-56583a05d4f391afc3a7bb1551be9724a6d7ba72.tar.gz
rspamd-56583a05d4f391afc3a7bb1551be9724a6d7ba72.zip
Support c11 if available
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)