diff options
author | Brad King <brad.king@kitware.com> | 2017-05-28 13:22:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-05-28 13:22:33 (GMT) |
commit | d375618921e16c229e748c87ea16190f2de74337 (patch) | |
tree | 3a06ffc8c26a4e9fff41fde1b5a6ac320020b5aa | |
parent | ff1563199cfa36fca21889fce8a6b89bcb7db241 (diff) | |
parent | 370d0d25315cc2fae38e1c6397b0094d43384c16 (diff) | |
download | CMake-d375618921e16c229e748c87ea16190f2de74337.zip CMake-d375618921e16c229e748c87ea16190f2de74337.tar.gz CMake-d375618921e16c229e748c87ea16190f2de74337.tar.bz2 |
Merge topic 'sunpro-std-flags'
370d0d25 SunPro: update flags used for CMake itself
f1f21e30 SunPro: set -library=stlport as standard compile option for C++98
9316120c SunPro: add standard compile option for C++03
783fbb77 Tests: Compile entire Plugin test with the same language standard
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !879
-rw-r--r-- | CompileFlags.cmake | 3 | ||||
-rw-r--r-- | Modules/Compiler/SunPro-CXX.cmake | 8 | ||||
-rw-r--r-- | Tests/Plugin/CMakeLists.txt | 6 |
3 files changed, 11 insertions, 6 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake index d1f4f13..7a9d4cd 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -59,7 +59,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc") endif() endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) +if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND + NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03") diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index 5db7987..4b0a21d 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -37,11 +37,15 @@ set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_RANLIB> <TARGET> ") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) - set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") - set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++03") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=c++03") set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION 1) +else() + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-library=stlport") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-library=stlport") + set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION 1) endif() __compiler_check_default_language_standard(CXX 5.13 98) diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index f52b479..9e2b4ab 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required (VERSION 2.6) cmake_policy(SET CMP0054 NEW) project(Plugin) +# We need proper C++98 support from the compiler +set(CMAKE_CXX_STANDARD 98) + # Test per-target output directory properties. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin) @@ -25,9 +28,6 @@ include_directories( ${Plugin_SOURCE_DIR}/include ) -# We need proper C++98 support from the compiler -set(CMAKE_CXX_STANDARD 98) - # Those versions of the HP compiler that need a flag to get proper C++98 # template support also need a flag to use the newer C++ library. if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND |