Commit d5d1b156 authored by Robert Maynard's avatar Robert Maynard Committed by Brad King
Browse files

CUDA: Filter out -framework arguments during device linking

The filter in commit e768d96c (CUDA: Filter out host link flags during
device linking, 2018-10-22, v3.13.0-rc2~4^2~2^2) removes `-framework`
but not the framework name that comes after it.  Revise the logic to
remove both.

Fixes: #18911
parent e6897c72
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment