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).
This commit is contained in:
Brad King 2015-09-29 11:22:50 -04:00
parent f23ab1a150
commit 61bc0f7363
2 changed files with 18 additions and 14 deletions

View File

@ -308,4 +308,4 @@ versions specified for each:
* ``Clang``: Clang compiler versions 2.9 through 3.4. * ``Clang``: Clang compiler versions 2.9 through 3.4.
* ``GNU``: GNU compiler versions 4.4 through 5.0. * ``GNU``: GNU compiler versions 4.4 through 5.0.
* ``MSVC``: Microsoft Visual Studio versions 2010 through 2015. * ``MSVC``: Microsoft Visual Studio versions 2010 through 2015.
* ``SunPro``: Oracle SolarisStudio version 12.4. * ``SunPro``: Oracle SolarisStudio version 12.4 on a Linux host.

View File

@ -31,17 +31,19 @@ set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> " "<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ") "<CMAKE_RANLIB> <TARGET> ")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
endif() 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_VERSION VERSION_LESS 5.13)
if (NOT CMAKE_CXX_COMPILER_FORCED) if (NOT CMAKE_CXX_COMPILER_FORCED)
if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT) 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}") 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() endif()
set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
endif() endif()
endif() endif()
@ -51,10 +53,12 @@ macro(cmake_record_cxx_compile_features)
endmacro() endmacro()
set(_result 0) set(_result 0)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) if (CMAKE_SYSTEM_NAME STREQUAL Linux)
_get_solaris_studio_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
if (_result EQUAL 0) _get_solaris_studio_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
_get_solaris_studio_features("" CMAKE_CXX98_COMPILE_FEATURES) if (_result EQUAL 0)
_get_solaris_studio_features("" CMAKE_CXX98_COMPILE_FEATURES)
endif()
endif() endif()
endif() endif()
endmacro() endmacro()