summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorYR Chen <stevapple@icloud.com>2023-03-18 15:34:39 +0800
committerBrad King <brad.king@kitware.com>2023-03-20 10:08:25 -0400
commit843fc607de7654bd24eab1b6d97d69ee989a8f9c (patch)
tree04557e6c199510099f9c6243e47c728225e9571e /Modules/CMakeDetermineCompilerId.cmake
parent3346570ae99b4f51a9b5b0a52f58765726d4ee2b (diff)
downloadcmake-843fc607de7654bd24eab1b6d97d69ee989a8f9c.tar.gz
Ninja: Restore detection of clang-cl showIncludes prefix
Since commit 8f82e755f3 (Ninja: Fix detection of MSVC showIncludes prefix in Italian, 2023-01-26, v3.26.0-rc1~20^2) our regex no longer matches the output from `clang-cl`, which uses a relative path, forward slashes, and is always in English [1]: Note: including file: ./foo.h Update the regex to match that too. [1] https://github.com/llvm/llvm-project/blob/llvmorg-16.0.0/clang/lib/Frontend/HeaderIncludeGen.cpp#L102 Co-authored-by: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 41e0e1a49e..f79e8b8d39 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -1144,7 +1144,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()