aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff904bac..b7bbe691 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -101,9 +101,14 @@ CHECK_TYPE_SIZE("long" SIZEOF_LONG)
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
-CHECK_C_COMPILER_FLAG(-std=c99 HAVE_STD_C99)
-IF(HAVE_STD_C99)
- SET(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
+CHECK_C_COMPILER_FLAG(-std=c11 HAVE_STD_C11)
+IF(HAVE_STD_C11)
+ SET(CMAKE_C_FLAGS "-std=c11 ${CMAKE_C_FLAGS}")
+ELSE()
+ CHECK_C_COMPILER_FLAG(-std=c99 HAVE_STD_C99)
+ IF(HAVE_STD_C99)
+ SET(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
+ ENDIF()
ENDIF()
# MSVC may need workarounds for C99 restrict and inline