diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2014-04-15 16:52:30 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2014-04-25 15:59:57 (GMT) |
commit | b0f277db3885cf75b4a153442a3e30ecedfab049 (patch) | |
tree | ee8b33d7f74b99fef38dcfa3c446c8a416b793ee /Tests | |
parent | fd8bb3427858017754d5b08a2eb1f57116feebb6 (diff) | |
download | CMake-b0f277db3885cf75b4a153442a3e30ecedfab049.zip CMake-b0f277db3885cf75b4a153442a3e30ecedfab049.tar.gz CMake-b0f277db3885cf75b4a153442a3e30ecedfab049.tar.bz2 |
HP aCC: record compiler flag for Ansi C++98 support for version 3.80 onwards
Old versions of aCC need a special compiler flag to get full C++98 template
support as e.g. CMake itself or the Complex and ComplexOneConfig tests need.
The same versions need a special flag to get a proper C++ library, too.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/AliasTarget/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/Complex/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/Module/GenerateExportHeader/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/Plugin/CMakeLists.txt | 10 |
5 files changed, 58 insertions, 1 deletions
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt index 9467fae..c50b4e6 100644 --- a/Tests/AliasTarget/CMakeLists.txt +++ b/Tests/AliasTarget/CMakeLists.txt @@ -1,7 +1,15 @@ - cmake_minimum_required(VERSION 2.8.11) project(AliasTarget) +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 + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () + add_library(foo SHARED empty.cpp) add_library(PREFIX::Foo ALIAS foo) add_library(Another::Alias ALIAS foo) diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index d250f53..5fa46bf 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -392,6 +392,21 @@ if(NOT RESULT STREQUAL "a[b]c[d]e") "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") endif() +# +# This tests needs Ansi C++98 +# +set(CMAKE_CXX_STANDARD 98) +# +# GNU extensions are needed for stricmp() on Windows. +# +set(CMAKE_CXX_EXTENSIONS TRUE) + +# 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 + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () # # Create the libs and the main exe diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index bb00341..d3d9132 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -362,6 +362,21 @@ if(NOT RESULT STREQUAL "a[b]c[d]e") "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") endif() +# +# This tests needs Ansi C++98 +# +set(CMAKE_CXX_STANDARD 98) +# +# GNU extensions are needed for stricmp() on Windows. +# +set(CMAKE_CXX_EXTENSIONS TRUE) + +# 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 + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () # # Create the libs and the main exe diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index bf867a9..b52c44d 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -57,6 +57,15 @@ endif() include(GenerateExportHeader) +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 + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () + add_subdirectory(lib_shared_and_static) add_compiler_export_flags() diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index c6ed15d..ecdece8 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -24,6 +24,16 @@ 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 + CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") +endif () + # Create an executable that exports an API for use by plugins. add_executable(example_exe src/example_exe.cxx) set_target_properties(example_exe PROPERTIES |