This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via 77705a2c2834e84a7413e01e5575201d1730b57a (commit) via 3f82c5904d89a892a51476898439cf4d99660fb4 (commit) via 8381bc12add724f1f262601b155485164b1842b1 (commit) via 6cddf7ba324a4cc5ce102e1c48d27ee7e9022b16 (commit) from 48d7aa2868ed3a8c15f83d9639a9dfd633c7608b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77705a2c2834e84a7413e01e5575201d1730b57a commit 77705a2c2834e84a7413e01e5575201d1730b57a Merge: 48d7aa2 3f82c59 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Apr 13 14:22:18 2018 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Apr 13 10:22:26 2018 -0400 Merge topic 'clang-cl-std' 3f82c5904d Clang: Add standard flags support when simulating MSVC 8381bc12ad Clang: Avoid extra C++ feature detection when simulating MSVC 6cddf7ba32 Clang: Refactor standard flags logic when simulating MSVC Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !1906 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f82c5904d89a892a51476898439cf4d99660fb4 commit 3f82c5904d89a892a51476898439cf4d99660fb4 Author: Ruben Van Boxem <vanboxem.ru...@gmail.com> AuthorDate: Sat Apr 7 10:42:28 2018 +0200 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Apr 11 14:50:22 2018 -0400 Clang: Add standard flags support when simulating MSVC When Clang 3.9 simulates MSVC 19.0 or higher it knows the `-std:` flags that such versions of MSVC defines. Fixes: #17866 diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index b24aaf4..e99011b 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -53,6 +53,27 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") unset(_clang_version_std17) __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) + # This version of clang-cl and the MSVC version it simulates have + # support for -std: flags. + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") + set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "") + set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "") + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std:c++14") + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std:c++14") + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) + set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++17") + set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++17") + set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest") + set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++latest") + else() + set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++latest") + set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++latest") + endif() + + __compiler_check_default_language_standard(CXX 3.9 14) else() # This version of clang-cl, or the MSVC version it simulates, does not have # language standards. Set these options as empty strings so the feature https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8381bc12add724f1f262601b155485164b1842b1 commit 8381bc12add724f1f262601b155485164b1842b1 Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed Apr 11 14:46:09 2018 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Apr 11 14:47:28 2018 -0400 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 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() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6cddf7ba324a4cc5ce102e1c48d27ee7e9022b16 commit 6cddf7ba324a4cc5ce102e1c48d27ee7e9022b16 Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed Apr 11 14:44:04 2018 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Apr 11 14:45:16 2018 -0400 Clang: Refactor standard flags logic when simulating MSVC Consolidate the compile options and standard defaults branches. Add comments. diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 77866e9..c5dd081 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -51,8 +51,12 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") endif() unset(_clang_version_std17) + + __compiler_check_default_language_standard(CXX 2.1 98) else() - # clang-cl does not know these options because it behaves like cl.exe + # This version of clang-cl, or the MSVC version it simulates, does not have + # language standards. Set these options as empty strings so the feature + # test infrastructure can at least check to see if they are defined. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "") @@ -63,10 +67,7 @@ else() set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "") set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "") -endif() -if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") - __compiler_check_default_language_standard(CXX 2.1 98) -else() + # There is no meaningful default for this set(CMAKE_CXX_STANDARD_DEFAULT "") endif() ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/Clang-CXX.cmake | 47 ++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 5 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits