summaryrefslogtreecommitdiffstats
path: root/CompileFlags.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CompileFlags.cmake')
-rw-r--r--CompileFlags.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index d70e3af..d1f4f13 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -61,7 +61,14 @@ endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
+ if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
+ elseif(CMAKE_VERSION VERSION_LESS 3.8.20170502)
+ # CMake knows how to add this flag for compilation as C++11,
+ # but has not been taught that SunPro needs it for linking too.
+ # Add it in a place that will be used for both.
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
endif()