Explorar el Código

Merge topic 'vs-compiler-id-tolerate-diagnostics'

8c891f8 VS: Tolerate diagnostic output while detecting cl (#14387)
Brad King hace 12 años
padre
commit
ea574d98ed
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      Modules/CMakeDetermineCompilerId.cmake

+ 2 - 1
Modules/CMakeDetermineCompilerId.cmake

@@ -161,7 +161,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)
         set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)