diff options
-rw-r--r-- | Modules/CMakeParseImplicitLinkInfo.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake | 4 |
2 files changed, 5 insertions, 5 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() diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake index 403d2e7..8d6c739 100644 --- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake +++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake @@ -173,9 +173,9 @@ foreach(t ${targets}) # File format # file(WRITE ${outfile} "libs=${implicit_libs}\ndirs=${idirs}\nlibrary_arch=${library_arch}\nlinker_tool=${linker_tool}\n") - if(NOT CMAKE_HOST_WIN32) + if(t MATCHES "windows" AND NOT CMAKE_HOST_WIN32) string(REPLACE "\\" "/" linker_tool "${linker_tool}") - cmake_path(SET linker_tool "${linker_tool}") + cmake_path(NORMAL_PATH linker_tool) endif() if(t MATCHES "-empty$") # empty isn't supposed to parse |