mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
Ninja: Record showIncludes detection in configure log
Also avoid running the detection multiple times.
This commit is contained in:
@@ -219,6 +219,9 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
|
||||
AND MSVC_${lang}_ARCHITECTURE_ID)
|
||||
foreach(userflags "${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}" "")
|
||||
CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX(${lang} "${userflags}")
|
||||
if(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "")
|
||||
@@ -1140,9 +1143,12 @@ function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang userflags)
|
||||
RESULT_VARIABLE res
|
||||
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]*:[ \t]*)")
|
||||
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}" PARENT_SCOPE)
|
||||
string(APPEND msg "\nFound prefix \"${CMAKE_MATCH_2}\"")
|
||||
else()
|
||||
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "" PARENT_SCOPE)
|
||||
endif()
|
||||
message(CONFIGURE_LOG "Detecting ${lang} compiler /showIncludes prefix:\n${msg}\n")
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user