Commit d3756189 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

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's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !879
parents ff156319 370d0d25
......@@ -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")
......
......@@ -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)
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment