summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeParseImplicitLinkInfo.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-08-23 20:49:27 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2019-08-28 14:39:53 (GMT)
commitb5f20da94dacf1502a2de1b33cbed69163b3e143 (patch)
treea884de8024c52d88a1461f1de99ca9ceb21bead9 /Modules/CMakeParseImplicitLinkInfo.cmake
parent2200bc068b8f6a127d92720c336142bd57ce994b (diff)
downloadCMake-b5f20da94dacf1502a2de1b33cbed69163b3e143.zip
CMake-b5f20da94dacf1502a2de1b33cbed69163b3e143.tar.gz
CMake-b5f20da94dacf1502a2de1b33cbed69163b3e143.tar.bz2
CMakeParseImplicitLinkInfo supports comma separated link lines
It is currently presumed that the linker will generate a space separated line. This is not the case for some compilers such as IBM XL where it can output space or comma separated. This is particularly apparent when IBM XL is used as the host compiler for CUDA as it generates a comma separated link line.
Diffstat (limited to 'Modules/CMakeParseImplicitLinkInfo.cmake')
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index 30659eb..0465515 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -47,6 +47,18 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
endif()
separate_arguments(args NATIVE_COMMAND "${line}")
list(GET args 0 cmd)
+ else()
+ #check to see if the link line is comma-separated instead of space separated
+ string(REGEX REPLACE "," " " line "${line}")
+ if("${line}" MATCHES "${linker_regex}" AND
+ NOT "${line}" MATCHES "${linker_exclude_regex}")
+ separate_arguments(args NATIVE_COMMAND "${line}")
+ list(GET args 0 cmd)
+ if("${cmd}" MATCHES "exec:")
+ # ibm xl sometimes has 'exec: ' in-front of the linker
+ list(GET args 1 cmd)
+ endif()
+ endif()
endif()
set(is_msvc 0)
if("${cmd}" MATCHES "${linker_regex}")