summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-29 15:22:50 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-29 15:25:07 (GMT)
commit61bc0f7363ca2917707d57fefb52b79b0114bb19 (patch)
tree8c16a2e35d909f44c994707087ce1b7d757833a0 /Modules/Compiler
parentf23ab1a1501cf82a04b9f24c3324e314afd53fab (diff)
downloadCMake-61bc0f7363ca2917707d57fefb52b79b0114bb19.zip
CMake-61bc0f7363ca2917707d57fefb52b79b0114bb19.tar.gz
CMake-61bc0f7363ca2917707d57fefb52b79b0114bb19.tar.bz2
Features: Disable support for Oracle SolarisStudio on non-Linux
On SunOS the -std=c++11 flag must be used for linking as well as compiling. Until we implement support for this we cannot support the CXX_STANDARD property except on Linux (where it was tested).
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake30
1 files changed, 17 insertions, 13 deletions
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index 50d68ee..dccc25e 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -31,17 +31,19 @@ set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ")
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
-endif()
+if (CMAKE_SYSTEM_NAME STREQUAL Linux)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
+ endif()
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
- if (NOT CMAKE_CXX_COMPILER_FORCED)
- if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
- message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ if (NOT CMAKE_CXX_COMPILER_FORCED)
+ if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
endif()
- set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
endif()
endif()
@@ -51,10 +53,12 @@ macro(cmake_record_cxx_compile_features)
endmacro()
set(_result 0)
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
- _get_solaris_studio_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
- if (_result EQUAL 0)
- _get_solaris_studio_features("" CMAKE_CXX98_COMPILE_FEATURES)
+ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ _get_solaris_studio_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+ if (_result EQUAL 0)
+ _get_solaris_studio_features("" CMAKE_CXX98_COMPILE_FEATURES)
+ endif()
endif()
endif()
endmacro()