summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-14 00:05:03 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-03 22:05:55 (GMT)
commit455aed3061a07f79c8af3c7bd68ebbdcd62e28eb (patch)
tree91369a0c35339189ac84f9683b4adeb748ec1fa2 /Modules
parent78b7ba64941cf6341939a85bd95b79692910cf77 (diff)
downloadCMake-455aed3061a07f79c8af3c7bd68ebbdcd62e28eb.zip
CMake-455aed3061a07f79c8af3c7bd68ebbdcd62e28eb.tar.gz
CMake-455aed3061a07f79c8af3c7bd68ebbdcd62e28eb.tar.bz2
LinkerId: Fix detection of linker tool for MSVC
Previously we matched an entire build system output line and then extracted the relevant portion in a separate brittle step. Match it directly. Use the `CMAKE_LINKER` value directly if available.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index b4a7860..dc7ea17 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -97,6 +97,8 @@ function(cmake_parse_implicit_link_info2 text log_var obj_regex)
if("${line}" MATCHES " --with-ld=([^ ]+/${linker})( |$)")
set(linker_tool_fallback "${CMAKE_MATCH_1}")
endif()
+ elseif("${line}" MATCHES "vs_link.*-- +([^\"]*[/\\](${linker})) ") # cmake -E vs_link_exe
+ set(linker_tool "${CMAKE_MATCH_1}")
elseif("${line}" MATCHES "${linker_tool_regex}")
set(linker_tool "${CMAKE_MATCH_2}")
endif()
@@ -270,9 +272,7 @@ function(cmake_parse_implicit_link_info2 text log_var obj_regex)
endif()
if(linker_tool)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
- # pick-up last path
- string(REGEX REPLACE "^.*([A-Za-z]:[/\\][^:]+)$" "\\1" linker_tool "${linker_tool}")
- cmake_path(SET linker_tool "${linker_tool}")
+ cmake_path(NORMAL_PATH linker_tool)
endif()
string(APPEND log " linker tool for '${EXTRA_PARSE_LANGUAGE}': ${linker_tool}\n")
endif()