summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-13 15:36:25 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-03 21:24:57 (GMT)
commit262de2ad926429749077a9651fc6c6176cd2f19c (patch)
tree3ec81dd73a609c079e5e970825c4acb523f418b9 /Modules
parenta80dca88a134530ef133e7b7fc71050175adad44 (diff)
downloadCMake-262de2ad926429749077a9651fc6c6176cd2f19c.zip
CMake-262de2ad926429749077a9651fc6c6176cd2f19c.tar.gz
CMake-262de2ad926429749077a9651fc6c6176cd2f19c.tar.bz2
LinkerId: Fix detection of linker tool for XL as nvcc host compiler
When IBM XL is used as the host compiler for nvcc, it generates a comma-separated link line. Parse the `exec:` line syntax separately, as was done in commit b5f20da94d (CMakeParseImplicitLinkInfo supports comma separated link lines, 2019-08-23, v3.16.0-rc1~181^2).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index 5fc7806..db39249 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]*(->|exec:|\")?[ \t]*(.*[/\\](${linker}))(\"|,| |$)")
+ set(linker_tool_regex "^[ \t]*(->|\")?[ \t]*(.*[/\\](${linker}))(\"|,| |$)")
set(linker_tool_exclude_regex "cuda-fake-ld|-fuse-ld=|--with-ld=")
set(linker_tool "NOTFOUND")
set(link_line_parsed 0)
@@ -86,7 +86,9 @@ function(cmake_parse_implicit_link_info2 text log_var obj_regex)
foreach(line IN LISTS output_lines)
if(EXTRA_PARSE_COMPUTE_LINKER AND
NOT linker_tool AND NOT "${line}" MATCHES "${linker_tool_exclude_regex}")
- if("${line}" MATCHES "${linker_tool_regex}")
+ if("${line}" MATCHES "exec: ([^()]*/(${linker}))") # IBM XL as nvcc host compiler
+ set(linker_tool "${CMAKE_MATCH_1}")
+ elseif("${line}" MATCHES "${linker_tool_regex}")
set(linker_tool "${CMAKE_MATCH_2}")
endif()
endif()