mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-03 05:08:47 -06:00
LinkerId: Prepare detection of linker tool for multiple match attempts
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user