diff options
author | Brad King <brad.king@kitware.com> | 2023-01-30 15:23:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-01-30 15:23:31 (GMT) |
commit | 1c4825066b782be7773d6e6a4358082df2cc55cb (patch) | |
tree | c38587b2162d7b4992d069a3bc60914f5d3d1faf /Modules/CMakeDetermineCompilerId.cmake | |
parent | 09cb6c48e27a3696796cfbb89822e468de0e491f (diff) | |
parent | 8f82e755f336c66194ce8229575e4651cb7a4c62 (diff) | |
download | CMake-1c4825066b782be7773d6e6a4358082df2cc55cb.zip CMake-1c4825066b782be7773d6e6a4358082df2cc55cb.tar.gz CMake-1c4825066b782be7773d6e6a4358082df2cc55cb.tar.bz2 |
Merge topic 'msvc-showIncludes'
8f82e755f3 Ninja: Fix detection of MSVC showIncludes prefix in Italian
d6e7e4d4a1 Tests: Extend RunCMake.Ninja ShowIncludes cases to cover more languages
9596305c0b Tests: Generalize RunCMake.Ninja ShowIncludes test infrastructure
c6dd4fa21d Tests: Extend RunCMake.Ninja ShowIncludes case with sample path
a9d97492fd Ninja: Record showIncludes detection in configure log
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8129
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index ece9f39..41e0e1a 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 ) - if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n]*:[^:\n]*:[ \t]*)") + string(REPLACE "\n" "\n " msg " ${out}") + if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n][^:\n]+:[^:\n]*[^: \n][^: \n]:?[ \t]+)[A-Za-z]:\\\\") 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() |