diff options
author | Brad King <brad.king@kitware.com> | 2017-05-08 13:46:15 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-05-08 13:46:20 (GMT) |
commit | 4c17299647c62ab698942bf1134f0e61c1ce07a2 (patch) | |
tree | 0cf685440be53e2402bbc0e8213cbf7bba95ad3a | |
parent | 033eafcf44a1337e26de52c7d2896c3f48788b12 (diff) | |
parent | 6b0bc4328100b5ec9e0d4a36487c82dc8cab91ae (diff) | |
download | CMake-4c17299647c62ab698942bf1134f0e61c1ce07a2.zip CMake-4c17299647c62ab698942bf1134f0e61c1ce07a2.tar.gz CMake-4c17299647c62ab698942bf1134f0e61c1ce07a2.tar.bz2 |
Merge topic 'libuv-solaris'
6b0bc432 libuv: Compile as C 99 on Solaris 5.11
b08d2d99 libuv: Compile as C 90 on Solaris 5.10 with SunPro 5.14
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !806
-rw-r--r-- | Utilities/cmlibuv/CMakeLists.txt | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index 6632a1e..b6e7941 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -221,13 +221,22 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") __EXTENSIONS__ ) if(CMAKE_SYSTEM_VERSION STREQUAL "5.10") + set(CMAKE_C_STANDARD 90) + if(CMAKE_VERSION VERSION_LESS 3.8.20170504 AND CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.14) + # The running version of CMake does not know how to add this flag. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90") + endif() list(APPEND uv_defines _XOPEN_SOURCE=500 ) - if(CMAKE_C_STANDARD) - set(CMAKE_C_STANDARD 90) - endif() else() + if(NOT CMAKE_C_STANDARD OR CMAKE_C_STANDARD EQUAL 90) + set(CMAKE_C_STANDARD 11) + endif() + if(CMAKE_VERSION VERSION_LESS 3.8.20170505 AND CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.14) + # The running version of CMake does not know how to add this flag. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -xc99") + endif() list(APPEND uv_defines _XOPEN_SOURCE=600 ) |