summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-05 13:47:51 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-05-05 13:47:57 (GMT)
commit5a9f1b87c30870a6a705f882039b2b4e98126813 (patch)
tree37dd06331daf4f5dbb8096f4d6897cdc091c33c2
parent053c0f1e44cc6900bb215b8eb2866f68211ebfe5 (diff)
parent1a09a7d9922502ea0a49be6aa6647bc9097082fd (diff)
downloadCMake-5a9f1b87c30870a6a705f882039b2b4e98126813.zip
CMake-5a9f1b87c30870a6a705f882039b2b4e98126813.tar.gz
CMake-5a9f1b87c30870a6a705f882039b2b4e98126813.tar.bz2
Merge topic 'add-more-sunpro-c-flags'
1a09a7d9 SunPro: Add more flags for C language standards Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !803
-rw-r--r--Modules/Compiler/SunPro-C.cmake15
1 files changed, 11 insertions, 4 deletions
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 263bbe4..29c2f22 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -27,14 +27,21 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
endforeach()
-if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.14)
- set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
- set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=c90")
+if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.13)
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=c89")
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=c99")
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=c11")
+elseif (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.11)
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "-xc99")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-xc99")
endif()
-__compiler_check_default_language_standard(C 5.13 90 5.14 11)
+__compiler_check_default_language_standard(C 5.11 90 5.14 11)
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>")