diff options
author | Brad King <brad.king@kitware.com> | 2020-01-10 18:18:30 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-10 18:21:12 (GMT) |
commit | 9fa8b7d5dda04b94fe04e63626e393fd6bf0353e (patch) | |
tree | a53f0d3d98b7b8fe83bf2344381336c1240436b8 /Source | |
parent | a7fc5df5d3cd1da907311ee8c57f9dbf74ff7bca (diff) | |
parent | 7ffa42288e4ce5a1f1c82ec2b661f81e6d6038ec (diff) | |
download | CMake-9fa8b7d5dda04b94fe04e63626e393fd6bf0353e.zip CMake-9fa8b7d5dda04b94fe04e63626e393fd6bf0353e.tar.gz CMake-9fa8b7d5dda04b94fe04e63626e393fd6bf0353e.tar.bz2 |
Merge topic 'cuda-device-link-only-cuda' into release-3.16
7ffa42288e Merge branch 'backport-3.15-cuda-device-link-only-cuda'
071c4f1a2a CUDA: Do not device link if target has no CUDA usage
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4191
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLinkLineDeviceComputer.cxx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx index d845652..847334b 100644 --- a/Source/cmLinkLineDeviceComputer.cxx +++ b/Source/cmLinkLineDeviceComputer.cxx @@ -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( |