summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-18 16:47:11 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-03 22:07:52 (GMT)
commit37bc1488703e22d40dea28706ed8a9e3574a1d77 (patch)
tree500f11c4d711af7a9ab0f78135b425836ef5c4f2 /Modules
parent6e527c2d385156bea79f6fe0647f4b9dba3c5022 (diff)
downloadCMake-37bc1488703e22d40dea28706ed8a9e3574a1d77.zip
CMake-37bc1488703e22d40dea28706ed8a9e3574a1d77.tar.gz
CMake-37bc1488703e22d40dea28706ed8a9e3574a1d77.tar.bz2
LinkerId: Fix detection of linker tool without path
Some compiler drivers invoke the linker tool as just `ld`, with no path, expecting it to be in the `PATH`.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index fcbfc11..896eac0 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -74,7 +74,7 @@ function(cmake_parse_implicit_link_info2 text log_var obj_regex)
# whole line and just the command (argv[0]).
set(linker_regex "^( *|.*[/\\])(${linker}|${startfile}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)")
set(linker_exclude_regex "collect2 version |^[A-Za-z0-9_]+=|/ldfe ")
- set(linker_tool_regex "^[ \t]*(->|\")?[ \t]*([^\"]*[/\\](${linker}))(\"|,| |$)")
+ set(linker_tool_regex "^[ \t]*(->|\")?[ \t]*(([^\"]*[/\\])?(${linker}))(\"|,| |$)")
set(linker_tool_exclude_regex "cuda-fake-ld|-fuse-ld=")
set(linker_tool "NOTFOUND")
set(linker_tool_fallback "")