summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang-CXX.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-11 18:46:09 (GMT)
committerBrad King <brad.king@kitware.com>2018-04-11 18:47:28 (GMT)
commit8381bc12add724f1f262601b155485164b1842b1 (patch)
tree857baaad2d6e2f67aec391752dc675a08158a352 /Modules/Compiler/Clang-CXX.cmake
parent6cddf7ba324a4cc5ce102e1c48d27ee7e9022b16 (diff)
downloadCMake-8381bc12add724f1f262601b155485164b1842b1.zip
CMake-8381bc12add724f1f262601b155485164b1842b1.tar.gz
CMake-8381bc12add724f1f262601b155485164b1842b1.tar.bz2
Clang: Avoid extra C++ feature detection when simulating MSVC
Apply the optimization from commit v3.10.0-rc1~131^2 (MSVC: Avoid unnecessary C++ feature detection steps, 2017-09-11) to the case of Clang simulating a version of MSVC that does not define standards. Issue: #17274
Diffstat (limited to 'Modules/Compiler/Clang-CXX.cmake')
-rw-r--r--Modules/Compiler/Clang-CXX.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index c5dd081..b24aaf4 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -70,4 +70,19 @@ else()
# There is no meaningful default for this
set(CMAKE_CXX_STANDARD_DEFAULT "")
+
+ # There are no compiler modes so we only need to test features once.
+ # Override the default macro for this special case. Pretend that
+ # all language standards are available so that at least compilation
+ # can be attempted.
+ macro(cmake_record_cxx_compile_features)
+ list(APPEND CMAKE_CXX_COMPILE_FEATURES
+ cxx_std_98
+ cxx_std_11
+ cxx_std_14
+ cxx_std_17
+ cxx_std_20
+ )
+ _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
+ endmacro()
endif()