Commit 6e0d92cc authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'clang-gnulike-support'

a4657ef6 Merge branch 'backport-clang-gnulike-support' into clang-gnulike-support
161b33f1 Help/guide/tutorial: Revert "require C++14 for the Tutorial"
4f15a6a5 Tests: Revert "require C++14 for the Tutorial"
5cfc3912 Merge branch 'backport-clang-gnulike-support' into clang-gnulike-support
d50b31be Clang: For MSVC ABI do not use modes older than C++14
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3592
parents 00be1957 a4657ef6
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set the version number
set(Tutorial_VERSION_MAJOR 1)
......
cmake_minimum_required(VERSION 3.3)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
endif()
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set the version number
set(Tutorial_VERSION_MAJOR 1)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set the version number
set(Tutorial_VERSION_MAJOR 1)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set the version number
set(Tutorial_VERSION_MAJOR 1)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set the version number
set(Tutorial_VERSION_MAJOR 1)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set the version number
set(Tutorial_VERSION_MAJOR 1)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set the version number
set(Tutorial_VERSION_MAJOR 1)
......
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set the version number
set(Tutorial_VERSION_MAJOR 1)
......
......@@ -58,6 +58,13 @@ if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
unset(_clang_version_std17)
if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
# The MSVC standard library requires C++14, and MSVC itself has no
# notion of operating in a mode not aware of at least that standard.
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++14")
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++14")
# This clang++ is missing some features because of MSVC compatibility.
unset(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT)
unset(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT)
......
......@@ -7,7 +7,7 @@ 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 14)
set(CMAKE_CXX_STANDARD 11)
endif()
add_library(foo SHARED empty.cpp)
......
......@@ -446,11 +446,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
set(CMAKE_CXX_STANDARD 11)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
set(CMAKE_CXX_STANDARD 14)
endif()
#
# Create the libs and the main exe
#
......
......@@ -403,11 +403,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
set(CMAKE_CXX_STANDARD 11)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
set(CMAKE_CXX_STANDARD 14)
endif()
#
# Create the libs and the main exe
#
......
......@@ -133,9 +133,7 @@ endif()
# for msvc the compiler version determines which c++11 features are available.
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"
OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
AND "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" ))
OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"))
if(";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;")
list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS)
list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
......
......@@ -5,17 +5,6 @@ project(Plugin)
# We need proper C++98 support from the compiler
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()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
set(CMAKE_CXX_STANDARD 14)
endif()
# 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)
......@@ -40,6 +29,12 @@ 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)
set_target_properties(example_exe PROPERTIES
......
......@@ -51,11 +51,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
set(CMAKE_CXX_STANDARD 11)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
set(CMAKE_CXX_STANDARD 14)
endif()
add_subdirectory(lib_shared_and_static)
if(CMAKE_SYSTEM_NAME MATCHES "AIX" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
......
Markdown is supported
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