From b08d2d993c8bcebf6b68222fb5b8e55fee047503 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 4 May 2017 12:57:31 -0400 Subject: libuv: Compile as C 90 on Solaris 5.10 with SunPro 5.14 --- Utilities/cmlibuv/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index 6632a1e..143209f 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -221,12 +221,14 @@ 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() list(APPEND uv_defines _XOPEN_SOURCE=600 -- cgit v0.12 From 6b0bc4328100b5ec9e0d4a36487c82dc8cab91ae Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 4 May 2017 13:08:22 -0400 Subject: libuv: Compile as C 99 on Solaris 5.11 SunPro 5.13 and below do not compile as c99 by default. --- Utilities/cmlibuv/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index 143209f..b6e7941 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -230,6 +230,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") _XOPEN_SOURCE=500 ) 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 ) -- cgit v0.12