Commit 66de0866 authored by Brad King's avatar Brad King

Ninja: Fix clang-cl /showIncludes prefix detection

We run MSVC-like compilers with the `/showIncludes` option and match the
output to extract the corresponding message.  Fix the matching to
support compilers like `clang-cl` that print the message on the first
line such that it is not preceded by a newline.

LLVM-Issue: https://llvm.org/bugs/show_bug.cgi?id=27226
parent 24b2a367
......@@ -664,8 +664,8 @@ function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang)
ERROR_VARIABLE err
RESULT_VARIABLE res
)
if(res EQUAL 0 AND "${out}" MATCHES "\n([^:]*:[^:]*:[ \t]*)")
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_1}" PARENT_SCOPE)
if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n]*:[^:\n]*:[ \t]*)")
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}" PARENT_SCOPE)
else()
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "" PARENT_SCOPE)
endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment