summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-29 13:21:53 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-29 13:22:12 (GMT)
commit067a4f484b1e2f650918d90051653b5c434c77a2 (patch)
treee0d9e8dd16e4518988067865f3f922f13a512b71 /Modules/Compiler
parent8b42d560028b8da0a3cf7e1a14962f2245d21227 (diff)
parent74829f01b13de0031e659bf8dac3e6672fbfa77b (diff)
downloadCMake-067a4f484b1e2f650918d90051653b5c434c77a2.zip
CMake-067a4f484b1e2f650918d90051653b5c434c77a2.tar.gz
CMake-067a4f484b1e2f650918d90051653b5c434c77a2.tar.bz2
Merge topic 'clang-gnulike-support'
74829f01b1 Help: Add notes for topic 'clang-gnulike-support' 19669abe1d Tests: handle string escaping differences with NMake+clang a2a90f41e3 Tests: require C++14 for the Tutorial 4819ff9647 Tests: fix failures with gnu mode clang on windows 26af0b25e7 cmake: use correct stack size with gnu mode clang on windows d44c0db0b2 clang: setup correct configuration in gnu mode b7d5ef23e9 cmGlobalNinjaGenerator: use gnu compatible paths with clang in gnu mode 3d0210d8dc binutils: add the llvm-* variants to the tool lists. ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Francesco Bertolaccini <francesco@bertolaccini.dev> Acked-by: Stanislav Ershov <digital.stream.of.mind@gmail.com> Acked-by: Saleem Abdulrasool <compnerd@compnerd.org> Merge-request: !2992
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/Clang-CXX.cmake13
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index c116078..17f3917 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -1,7 +1,7 @@
include(Compiler/Clang)
__compiler_clang(CXX)
-if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
@@ -10,7 +10,8 @@ if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
return()
endif()
-if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+
+if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
@@ -56,6 +57,14 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
unset(_clang_version_std17)
+ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ # This clang++ is missing some features because of MSVC compatibility.
+ unset(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT)
+ unset(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT)
+ unset(CMAKE_CXX17_STANDARD__HAS_FULL_SUPPORT)
+ unset(CMAKE_CXX20_STANDARD__HAS_FULL_SUPPORT)
+ endif()
+
__compiler_check_default_language_standard(CXX 2.1 98)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9
AND CMAKE_CXX_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.0)