Commit 8c891f86 authored by Brad King's avatar Brad King

VS: Tolerate diagnostic output while detecting cl (#14387)

When the VS IDE build output setting

  Tools -> Options -> Projects and Solutions ->
   Build and Run -> MSBuild project output verbosity

is set to "Diagnostic" the build output contains a " (TaskId:###)"
suffix on the CMAKE_<lang>_COMPILER= line used to extract the compiler
executable location.  Strip this suffix before checking that the
reported location exists.
parent dccc2b84
......@@ -157,7 +157,8 @@ Id flags: ${testflags}
# Match the compiler location line printed out.
if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "CMAKE_${lang}_COMPILER=([^%\r\n]+)[\r\n]")
set(_comp "${CMAKE_MATCH_1}")
# Strip VS diagnostic output from the end of the line.
string(REGEX REPLACE " \\(TaskId:[0-9]*\\)$" "" _comp "${CMAKE_MATCH_1}")
if(EXISTS "${_comp}")
file(TO_CMAKE_PATH "${_comp}" _comp)
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