diff options
author | Brad King <brad.king@kitware.com> | 2023-01-26 19:43:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-01-27 15:55:37 (GMT) |
commit | a9d97492fdd8d8689ede256d88546abb2fd70c7e (patch) | |
tree | e6f0bda72a7a2bc73de8ffddf0cb04af7da2ffc8 /Modules/CMakeDetermineCompilerId.cmake | |
parent | 7ac338be9830bdc936b52a4135504ed011418f3c (diff) | |
download | CMake-a9d97492fdd8d8689ede256d88546abb2fd70c7e.zip CMake-a9d97492fdd8d8689ede256d88546abb2fd70c7e.tar.gz CMake-a9d97492fdd8d8689ede256d88546abb2fd70c7e.tar.bz2 |
Ninja: Record showIncludes detection in configure log
Also avoid running the detection multiple times.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index ece9f39..448e606 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -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() |