diff options
author | Brad King <brad.king@kitware.com> | 2018-10-24 14:03:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-24 14:14:32 (GMT) |
commit | cf92fd9ae9a50491e0e5a24d127b82dbda211a25 (patch) | |
tree | 3bf52149984d97ebdaec133e2a88c2381beff6bd /Source/cmLinkLineDeviceComputer.cxx | |
parent | 718033b97d56d97cb0b16d82cb5fdd565d6b2b83 (diff) | |
parent | e768d96c74579c79e184027775e51b08cd77fe45 (diff) | |
download | CMake-cf92fd9ae9a50491e0e5a24d127b82dbda211a25.zip CMake-cf92fd9ae9a50491e0e5a24d127b82dbda211a25.tar.gz CMake-cf92fd9ae9a50491e0e5a24d127b82dbda211a25.tar.bz2 |
Merge branch 'cuda-filter-device-link-items' into cuda-thread-flags
Diffstat (limited to 'Source/cmLinkLineDeviceComputer.cxx')
-rw-r--r-- | Source/cmLinkLineDeviceComputer.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx index c9bbde1..025c6e4 100644 --- a/Source/cmLinkLineDeviceComputer.cxx +++ b/Source/cmLinkLineDeviceComputer.cxx @@ -25,6 +25,23 @@ cmLinkLineDeviceComputer::~cmLinkLineDeviceComputer() { } +static bool cmLinkItemValidForDevice(std::string const& item) +{ + // Valid items are: + // * Non-flags (does not start in '-') + // * Specific flags --library, --library-path, -l, -L + // For example: + // * 'cublas_device' => pass-along + // * '--library pthread' => pass-along + // * '-lpthread' => pass-along + // * '-pthread' => drop + // * '-a' => drop + return (!cmHasLiteralPrefix(item, "-") || // + cmHasLiteralPrefix(item, "-l") || // + cmHasLiteralPrefix(item, "-L") || // + cmHasLiteralPrefix(item, "--library")); +} + std::string cmLinkLineDeviceComputer::ComputeLinkLibraries( cmComputeLinkInformation& cli, std::string const& stdLibString) { @@ -69,7 +86,7 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries( } out += this->ConvertToOutputFormat(this->ConvertToLinkReference(item.Value)); - } else { + } else if (cmLinkItemValidForDevice(item.Value)) { out += item.Value; } |