summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-14 16:40:54 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-03 21:24:57 (GMT)
commita80dca88a134530ef133e7b7fc71050175adad44 (patch)
tree23c99a3c29e5bde0c0f1872e2a27ff761420500f
parenta192dc9fad8f3abda4c4dfdd28a15f7f54a6d5e0 (diff)
downloadCMake-a80dca88a134530ef133e7b7fc71050175adad44.zip
CMake-a80dca88a134530ef133e7b7fc71050175adad44.tar.gz
CMake-a80dca88a134530ef133e7b7fc71050175adad44.tar.bz2
LinkerId: Prepare detection of linker tool for multiple match attempts
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake20
1 files changed, 12 insertions, 8 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index f62de4c..5fc7806 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -85,15 +85,10 @@ function(cmake_parse_implicit_link_info2 text log_var obj_regex)
string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
foreach(line IN LISTS output_lines)
if(EXTRA_PARSE_COMPUTE_LINKER AND
- NOT linker_tool AND NOT "${line}" MATCHES "${linker_tool_exclude_regex}"
- AND "${line}" MATCHES "${linker_tool_regex}")
- set(linker_tool "${CMAKE_MATCH_2}")
- 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}")
+ NOT linker_tool AND NOT "${line}" MATCHES "${linker_tool_exclude_regex}")
+ if("${line}" MATCHES "${linker_tool_regex}")
+ set(linker_tool "${CMAKE_MATCH_2}")
endif()
- string(APPEND log " linker tool for '${EXTRA_PARSE_LANGUAGE}': ${linker_tool}\n")
endif()
if(NOT (EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS OR EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS
OR EXTRA_PARSE_COMPUTE_IMPLICIT_FWKS OR EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS))
@@ -259,6 +254,15 @@ function(cmake_parse_implicit_link_info2 text log_var obj_regex)
endif()
endforeach()
+ 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}")
+ endif()
+ string(APPEND log " linker tool for '${EXTRA_PARSE_LANGUAGE}': ${linker_tool}\n")
+ endif()
+
# Look for library search paths reported by linker.
if(EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS AND "${output_lines}" MATCHES ";Library search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_dirs_match "${CMAKE_MATCH_1}")