summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorZsolt Parragi <zsolt.parragi@cancellar.hu>2019-02-20 11:19:08 (GMT)
committerZsolt Parragi <zsolt.parragi@cancellar.hu>2019-05-23 21:35:33 (GMT)
commitd44c0db0b2f8fa24b932b5c0d506fc8842baffd6 (patch)
treed359d49e3ea73f109d098a331755e789346b8184 /Modules/Compiler
parentb7d5ef23e9c9c76c7b8422c969ce806f9fd965e6 (diff)
downloadCMake-d44c0db0b2f8fa24b932b5c0d506fc8842baffd6.zip
CMake-d44c0db0b2f8fa24b932b5c0d506fc8842baffd6.tar.gz
CMake-d44c0db0b2f8fa24b932b5c0d506fc8842baffd6.tar.bz2
clang: setup correct configuration in gnu mode
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)