mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 22:30:07 -05:00
Tests: Remove incidental use of C++98 compiler modes
Several tests specify use of C++98 mode since commitb0f277db38(HP aCC: record compiler flag for Ansi C++98 support for version 3.80 onwards, 2014-04-15, v3.1.0-rc1~550^2). The motivating use case for those changes was dropped by commit49640d3629(HP-UX: Drop support for building CMake on HP-UX, 2017-08-04, v3.10.0-rc1~304^2), so remove the use of C++98 mode too. Also remove code that, on some compilers, used C++11 instead of C++98, because we can now just use their default mode.
This commit is contained in:
@@ -2,14 +2,6 @@ cmake_minimum_required(VERSION 2.8.11)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
project(AliasTarget)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
|
||||
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
|
||||
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
add_library(foo SHARED empty.cpp)
|
||||
add_library(PREFIX::Foo ALIAS foo)
|
||||
add_library(Another::Alias ALIAS foo)
|
||||
|
||||
@@ -431,21 +431,6 @@ 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)
|
||||
|
||||
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
|
||||
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Create the libs and the main exe
|
||||
#
|
||||
|
||||
@@ -388,21 +388,6 @@ 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)
|
||||
|
||||
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
|
||||
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Create the libs and the main exe
|
||||
#
|
||||
|
||||
@@ -2,9 +2,6 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
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)
|
||||
@@ -21,12 +18,6 @@ include_directories(
|
||||
${Plugin_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
|
||||
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
# Create an executable that exports an API for use by plugins.
|
||||
add_executable(example_exe src/example_exe.cxx src/DynamicLoader.cxx)
|
||||
set_target_properties(example_exe PROPERTIES
|
||||
|
||||
@@ -43,14 +43,6 @@ endif()
|
||||
|
||||
include(GenerateExportHeader)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
|
||||
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
|
||||
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
add_subdirectory(lib_shared_and_static)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "AIX" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
||||
|
||||
Reference in New Issue
Block a user