summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-21 12:58:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-03-21 12:58:43 (GMT)
commitca8c171021369f535fa18013796cc0b8f9cbd4fc (patch)
treefe86b75fd9f168720d40c29d0763af751ddba1ab /Modules/Compiler
parent5f8929f721966f7560d18811126d74553af3df5f (diff)
parent1b7c26da49e7e1a337f66951424bda8d3f4067fc (diff)
downloadCMake-ca8c171021369f535fa18013796cc0b8f9cbd4fc.zip
CMake-ca8c171021369f535fa18013796cc0b8f9cbd4fc.tar.gz
CMake-ca8c171021369f535fa18013796cc0b8f9cbd4fc.tar.bz2
Merge topic 'clang-windows-cxx-modules'
1b7c26da49 Ninja: Wrap rules using '>' shell redirection with 'cmd /C' on Windows ffd8537acf Clang: Record Clang 16.0 C++ modules flags only for GNU-like front-end 6013227230 cmGlobalNinjaGenerator: Use forward slashes in clang modmap format on Windows d9d74b5e8a cmDyndepCollation: Drop outdated mentions of CXX_MODULE_INTERNAL_PARTITIONS edab56d29a cmLocalNinjaGenerator: De-duplicate condition for using 'cmd /C' on Windows 8ebe3f92b3 cmGlobalNinjaGenerator: Detect GNU-like command-line for dyndep collator f3ca199c9b cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on Windows f79817fcf0 cmCxxModuleMapper: Use value semantics in path conversion callback ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8346
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/Clang-CXX.cmake28
1 files changed, 15 insertions, 13 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 33154fd..a74e90b 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -30,16 +30,18 @@ if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
endif()
endif()
-if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
- string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE
- "${CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS}"
- " -format=p1689"
- " --"
- " <CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS>"
- " -x c++ <SOURCE> -c -o <OBJECT>"
- " -MT <DYNDEP_FILE>"
- " -MD -MF <DEP_FILE>"
- " > <DYNDEP_FILE>")
- set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "clang")
- set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "@<MODULE_MAP_FILE>")
-endif ()
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
+ if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE
+ "\"${CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS}\""
+ " -format=p1689"
+ " --"
+ " <CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS>"
+ " -x c++ <SOURCE> -c -o <OBJECT>"
+ " -MT <DYNDEP_FILE>"
+ " -MD -MF <DEP_FILE>"
+ " > <DYNDEP_FILE>")
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "clang")
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "@<MODULE_MAP_FILE>")
+ endif()
+endif()