1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-18 00:02:21 +08:00

CUDA: Restore device linking to imported static library targets

This ability was lost in commit 81b4d10d8f (CUDA: More exhaustive checks
to determine when to do device linking, 2019-05-09, v3.15.0-rc1~82^2)
and needs to be restored to use imported static libraries that have CUDA
symbols.
This commit is contained in:
Robert Maynard
2019-07-08 09:41:31 -04:00
committed by Brad King
parent 753373579e
commit 8895449648

View File

@@ -89,12 +89,17 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries(
} }
if (item.Target) { if (item.Target) {
bool skip = true; bool skip = false;
if (item.Target->GetType() == cmStateEnums::STATIC_LIBRARY) { switch (item.Target->GetType()) {
if ((!item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS")) && case cmStateEnums::MODULE_LIBRARY:
item.Target->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) { case cmStateEnums::INTERFACE_LIBRARY:
skip = false; skip = true;
} break;
case cmStateEnums::STATIC_LIBRARY:
skip = item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS");
break;
default:
break;
} }
if (skip) { if (skip) {
continue; continue;