summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/PGI-CXX.cmake2
-rw-r--r--Modules/Compiler/SunPro-C-FeatureTests.cmake14
-rw-r--r--Modules/Compiler/SunPro-C.cmake15
-rw-r--r--Modules/Compiler/SunPro-Fortran.cmake4
4 files changed, 32 insertions, 3 deletions
diff --git a/Modules/Compiler/PGI-CXX.cmake b/Modules/Compiler/PGI-CXX.cmake
index abc7349..35076bb 100644
--- a/Modules/Compiler/PGI-CXX.cmake
+++ b/Modules/Compiler/PGI-CXX.cmake
@@ -3,7 +3,7 @@ __compiler_pgi(CXX)
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
-if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10)
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION -A)
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --gnu_extensions)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.10)
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>")
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index 6607926..9b25c0b 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -19,7 +19,7 @@ set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
set(CMAKE_Fortran_MODPATH_FLAG "-M")
set(CMAKE_Fortran_PREPROCESS_SOURCE
- "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F <SOURCE> -o <PREPROCESSED_SOURCE>")
+ "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F -fpp <SOURCE> -o <PREPROCESSED_SOURCE>")
-set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F <SOURCE> -o <PREPROCESSED_SOURCE>")
+set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F -fpp <SOURCE> -o <PREPROCESSED_SOURCE>")
set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")