summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-03-01 14:07:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-03-01 14:08:56 (GMT)
commit980d9a987d10529e9e69d6d1991e0861fe03865d (patch)
tree0b35197eff88d072c8bf8043d413934eca764990 /Source
parent4cda0b66fa67bdf1ef0e3c859e49039366b981ff (diff)
parentd5d1b1565499b293589dd94e8511d8f22e862d47 (diff)
downloadCMake-980d9a987d10529e9e69d6d1991e0861fe03865d.zip
CMake-980d9a987d10529e9e69d6d1991e0861fe03865d.tar.gz
CMake-980d9a987d10529e9e69d6d1991e0861fe03865d.tar.bz2
Merge topic 'cuda_device_link_handle_frameworks'
d5d1b15654 CUDA: Filter out -framework arguments during device linking Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3039
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index a403dc9..211d03b 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -34,6 +34,7 @@ static bool cmLinkItemValidForDevice(std::string const& item)
// * '-lpthread' => pass-along
// * '-pthread' => drop
// * '-a' => drop
+ // * '-framework Name' (as one string) => drop
return (!cmHasLiteralPrefix(item, "-") || //
cmHasLiteralPrefix(item, "-l") || //
cmHasLiteralPrefix(item, "-L") || //
@@ -54,7 +55,13 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries(
typedef cmComputeLinkInformation::ItemVector ItemVector;
ItemVector const& items = cli.GetItems();
std::string config = cli.GetConfig();
+ bool skipItemAfterFramework = false;
for (auto const& item : items) {
+ if (skipItemAfterFramework) {
+ skipItemAfterFramework = false;
+ continue;
+ }
+
if (item.Target) {
bool skip = false;
switch (item.Target->GetType()) {
@@ -84,6 +91,11 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries(
out += this->ConvertToOutputFormat(
this->ConvertToLinkReference(item.Value));
}
+ } else if (item.Value == "-framework") {
+ // This is the first part of '-framework Name' where the framework
+ // name is specified as a following item. Ignore both.
+ skipItemAfterFramework = true;
+ continue;
} else if (cmLinkItemValidForDevice(item.Value)) {
out += item.Value;
}