diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2017-05-04 17:45:46 (GMT) |
---|---|---|
committer | Chuck Atkins <chuck.atkins@kitware.com> | 2017-05-04 18:10:07 (GMT) |
commit | 1a09a7d9922502ea0a49be6aa6647bc9097082fd (patch) | |
tree | efdb98a5c36b3d7f201c6585c67e77f6199dd583 /Modules/Compiler | |
parent | 30cb24f39cb5bd4dc053662d4cf1b124813e63d8 (diff) | |
download | CMake-1a09a7d9922502ea0a49be6aa6647bc9097082fd.zip CMake-1a09a7d9922502ea0a49be6aa6647bc9097082fd.tar.gz CMake-1a09a7d9922502ea0a49be6aa6647bc9097082fd.tar.bz2 |
SunPro: Add more flags for C language standards
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/SunPro-C.cmake | 15 |
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>") |