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) {
bool skip = true;
if (item.Target->GetType() == cmStateEnums::STATIC_LIBRARY) {
if ((!item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS")) &&
item.Target->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) {
skip = false;
}
bool skip = false;
switch (item.Target->GetType()) {
case cmStateEnums::MODULE_LIBRARY:
case cmStateEnums::INTERFACE_LIBRARY:
skip = true;
break;
case cmStateEnums::STATIC_LIBRARY:
skip = item.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS");
break;
default:
break;
}
if (skip) {
continue;