mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 02:59:22 -05:00
Merge topic 'cuda-device-link-only-cuda' into release-3.16
7ffa42288eMerge branch 'backport-3.15-cuda-device-link-only-cuda'071c4f1a2aCUDA: Do not device link if target has no CUDA usage Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4191
This commit is contained in:
@@ -183,29 +183,29 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
|
||||
return cmIsOn(resolveDeviceSymbols);
|
||||
}
|
||||
|
||||
if (const char* separableCompilation =
|
||||
target.GetProperty("CUDA_SEPARABLE_COMPILATION")) {
|
||||
if (cmIsOn(separableCompilation)) {
|
||||
bool doDeviceLinking = false;
|
||||
switch (target.GetType()) {
|
||||
case cmStateEnums::SHARED_LIBRARY:
|
||||
case cmStateEnums::MODULE_LIBRARY:
|
||||
case cmStateEnums::EXECUTABLE:
|
||||
doDeviceLinking = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return doDeviceLinking;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if we have any dependencies that require
|
||||
// us to do a device link step
|
||||
cmGeneratorTarget::LinkClosure const* closure =
|
||||
target.GetLinkClosure(config);
|
||||
|
||||
if (cmContains(closure->Languages, "CUDA")) {
|
||||
if (const char* separableCompilation =
|
||||
target.GetProperty("CUDA_SEPARABLE_COMPILATION")) {
|
||||
if (cmIsOn(separableCompilation)) {
|
||||
bool doDeviceLinking = false;
|
||||
switch (target.GetType()) {
|
||||
case cmStateEnums::SHARED_LIBRARY:
|
||||
case cmStateEnums::MODULE_LIBRARY:
|
||||
case cmStateEnums::EXECUTABLE:
|
||||
doDeviceLinking = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return doDeviceLinking;
|
||||
}
|
||||
}
|
||||
|
||||
cmComputeLinkInformation* pcli = target.GetLinkInformation(config);
|
||||
if (pcli) {
|
||||
cmLinkLineDeviceComputer deviceLinkComputer(
|
||||
|
||||
Reference in New Issue
Block a user