summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CompileFlags.cmake3
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake8
-rw-r--r--Tests/Plugin/CMakeLists.txt6
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