summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2024-02-06 21:58:44 (GMT)
committerBrad King <brad.king@kitware.com>2024-02-07 14:38:14 (GMT)
commit0d933fc0d9bb7bdaed1997c0ae06567115242f74 (patch)
treea35cd4850c3d520af1a3b21d626a1a576a640327 /Modules
parenta88acb0a419d184102c65ee9456950f2cea1cc71 (diff)
downloadCMake-0d933fc0d9bb7bdaed1997c0ae06567115242f74.zip
CMake-0d933fc0d9bb7bdaed1997c0ae06567115242f74.tar.gz
CMake-0d933fc0d9bb7bdaed1997c0ae06567115242f74.tar.bz2
Ninja: Update showIncludes prefix detection for clang-cl 18
Since commit LLVM/Clang commit `5523fefb01c2` ([clang][lex] Use preferred path separator in includer-relative lookup, 2023-09-08), part of the upcoming 18.x release, the output format of the showIncludes flag has changed, where it now prints paths with double backslashes: Note: including file: .\\foo.h Previously, we expected to see the path name in the form "./foo.h". Extend the regex to match a path name starting with `.\`, in addition to the existing matched patterns.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 4f1eaba..dde2b28 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -1173,7 +1173,7 @@ function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang userflags)
ENCODING AUTO # cl prints in console output code page
)
string(REPLACE "\n" "\n " msg " ${out}")
- if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n][^:\n]+:[^:\n]*[^: \n][^: \n]:?[ \t]+)([A-Za-z]:\\\\|\\./|/)")
+ if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n][^:\n]+:[^:\n]*[^: \n][^: \n]:?[ \t]+)([A-Za-z]:\\\\|\\./|\\.\\\\|/)")
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}" PARENT_SCOPE)
string(APPEND msg "\nFound prefix \"${CMAKE_MATCH_2}\"")
else()