summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-11 19:56:27 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-11 19:59:48 (GMT)
commit5d13fe282255d828f7aaf7765a1b069839161ee8 (patch)
tree45a557eb691c1112ba6fa33452409b2e9c280490 /Modules/Compiler
parent8e2f3582eb9cf75c78fbe8232cdacce2357f7efc (diff)
downloadCMake-5d13fe282255d828f7aaf7765a1b069839161ee8.zip
CMake-5d13fe282255d828f7aaf7765a1b069839161ee8.tar.gz
CMake-5d13fe282255d828f7aaf7765a1b069839161ee8.tar.bz2
Features: Record features for SunPro C 5.13 and 5.14
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/SunPro-C-FeatureTests.cmake14
-rw-r--r--Modules/Compiler/SunPro-C.cmake15
2 files changed, 29 insertions, 0 deletions
diff --git a/Modules/Compiler/SunPro-C-FeatureTests.cmake b/Modules/Compiler/SunPro-C-FeatureTests.cmake
new file mode 100644
index 0000000..cccf3ae
--- /dev/null
+++ b/Modules/Compiler/SunPro-C-FeatureTests.cmake
@@ -0,0 +1,14 @@
+set(_cmake_oldestSupported "__SUNPRO_C >= 0x5130")
+
+set(SunPro_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L || __STDC_VERSION__ >= 199901L && defined(__C11FEATURES__))")
+set(_cmake_feature_test_c_static_assert "${SunPro_C11}")
+unset(SunPro_C11)
+
+set(SunPro_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
+set(_cmake_feature_test_c_restrict "${SunPro_C99}")
+set(_cmake_feature_test_c_variadic_macros "${SunPro_C99}")
+unset(SunPro_C99)
+
+set(SunPro_C90 "${_cmake_oldestSupported}")
+set(_cmake_feature_test_c_function_prototypes "${SunPro_C90}")
+unset(SunPro_C90)
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 29c2f22..ac88e6f 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -43,5 +43,20 @@ endif()
__compiler_check_default_language_standard(C 5.11 90 5.14 11)
+macro(cmake_record_c_compile_features)
+ set(_result 0)
+ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.13)
+ if(_result EQUAL 0 AND CMAKE_C11_STANDARD_COMPILE_OPTION)
+ _record_compiler_features_c(11)
+ endif()
+ if (_result EQUAL 0)
+ _record_compiler_features_c(99)
+ endif()
+ if (_result EQUAL 0)
+ _record_compiler_features_c(90)
+ endif()
+ endif()
+endmacro()
+
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")