summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/GNU-C-FeatureTests.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-20 13:40:14 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-05-20 13:40:14 (GMT)
commitc1edede31f4e979826a5fc0f6e56b1b59cb00f21 (patch)
tree11ca8f038a7e363ebd7b218d5cf753fae4b1cd4d /Modules/Compiler/GNU-C-FeatureTests.cmake
parent8897116df8e8a6576f2736b96b8e0d529c26139e (diff)
parente0890d03a48d12904ffe24aa94fb2847d8d5f4e7 (diff)
downloadCMake-c1edede31f4e979826a5fc0f6e56b1b59cb00f21.zip
CMake-c1edede31f4e979826a5fc0f6e56b1b59cb00f21.tar.gz
CMake-c1edede31f4e979826a5fc0f6e56b1b59cb00f21.tar.bz2
Merge topic 'compile-features-C-language'
e0890d03 Features: Extend concept to C language.
Diffstat (limited to 'Modules/Compiler/GNU-C-FeatureTests.cmake')
-rw-r--r--Modules/Compiler/GNU-C-FeatureTests.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake
new file mode 100644
index 0000000..dc1695c
--- /dev/null
+++ b/Modules/Compiler/GNU-C-FeatureTests.cmake
@@ -0,0 +1,12 @@
+
+set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407")
+
+set(GNU46_C11 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 201112L")
+set(_cmake_feature_test_c_static_assert "${GNU46_C11}")
+# Since 4.4 at least:
+set(GNU44_C99 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 199901L")
+set(_cmake_feature_test_c_restrict "${GNU44_C99}")
+set(_cmake_feature_test_c_variadic_macros "${GNU44_C99}")
+
+set(GNU_C90 "${_cmake_oldestSupported} && !defined(__STDC_VERSION__)")
+set(_cmake_feature_test_c_function_prototypes "${GNU_C90}")