summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-03 12:40:20 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-03 12:43:13 (GMT)
commit66de0866a3ddd0fc6ef4d7333f08135180a5c3cf (patch)
treeadfdd0ed8895605fe67848d79b4c89b222d9bea4 /Modules
parent24b2a36778fd65f7066a964cf9f5d249f8e0f101 (diff)
downloadCMake-66de0866a3ddd0fc6ef4d7333f08135180a5c3cf.zip
CMake-66de0866a3ddd0fc6ef4d7333f08135180a5c3cf.tar.gz
CMake-66de0866a3ddd0fc6ef4d7333f08135180a5c3cf.tar.bz2
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
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index b1a2cf2..465989d 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -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()