瀏覽代碼

Recognize linker commands without paths

This teaches the implicit link line parsing code to recognize link lines
that do not have a full path to the linker executable.  At least one
version of the Intel compiler on Linux invokes the linker as just "ld"
instead of "/usr/bin/ld".
Brad King 16 年之前
父節點
當前提交
edad475e26
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Modules/CMakeParseImplicitLinkInfo.cmake

+ 1 - 1
Modules/CMakeParseImplicitLinkInfo.cmake

@@ -12,7 +12,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var)
   if(CMAKE_LINKER)
     get_filename_component(linker ${CMAKE_LINKER} NAME)
   endif()
-  set(linker_regex "/(${linker}|ld|collect2)")
+  set(linker_regex "^( *|.*/)(${linker}|ld|collect2)")
   string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
   foreach(line IN LISTS output_lines)
     set(cmd)