summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-15 14:37:03 -0400
committerBrad King <brad.king@kitware.com>2023-05-15 15:34:55 -0400
commitfb3c4715cd88bce564e3e64d844cdf4e9bebfb25 (patch)
treee9ad6e38011de33ad1426ff88c0396755668b4dc /Modules
parent822aa26915613d87de8ee19c8b45f7535ffca98f (diff)
downloadcmake-fb3c4715cd88bce564e3e64d844cdf4e9bebfb25.tar.gz
Ninja: Restore detection of msvc-wine 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 `msvc-wine`, which uses forward slashes: Note: including file: /path/to/foo.h `cl /showIncludes` under Wine prints paths of the form `Z:\path\to\file`, but the `msvc-wine` wrapper converts them to the form `/path/to/file` so that native Ninja can be used. Update our regex to match the prefix followed by a path with a leading forward slash. Fixes: #24908
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 f79e8b8d39..2250d63e78 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()