summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-22 14:29:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-22 14:30:00 (GMT)
commitfc4cbbc2a5f9f7d38e77c991a88400b29c39f182 (patch)
tree82f9614ac1585e57dd33dbae87639af927db2613 /Source/cmNinjaNormalTargetGenerator.cxx
parentc024e44abea66e37fefe358659d70d8811dd73c8 (diff)
parent81b4d10d8f421242f9989ff0c2d37a12be66f405 (diff)
downloadCMake-fc4cbbc2a5f9f7d38e77c991a88400b29c39f182.zip
CMake-fc4cbbc2a5f9f7d38e77c991a88400b29c39f182.tar.gz
CMake-fc4cbbc2a5f9f7d38e77c991a88400b29c39f182.tar.bz2
Merge topic 'remove_unneeded_device_link_calls'
81b4d10d8f CUDA: More exhaustive checks to determine when to do device linking 3205c7c950 cmNinjaLinkLineDeviceComputer now lives in the correct source file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3320
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx30
1 files changed, 4 insertions, 26 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index b4a6a5d..1221a3f 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -22,6 +22,7 @@
#include "cmLocalGenerator.h"
#include "cmLocalNinjaGenerator.h"
#include "cmMakefile.h"
+#include "cmNinjaLinkLineDeviceComputer.h"
#include "cmNinjaTypes.h"
#include "cmOSXBundleGenerator.h"
#include "cmOutputConverter.h"
@@ -574,32 +575,9 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
cmGeneratorTarget& genTarget = *this->GetGeneratorTarget();
- // determine if we need to do any device linking for this target
- const std::string cuda_lang("CUDA");
- cmGeneratorTarget::LinkClosure const* closure =
- genTarget.GetLinkClosure(this->GetConfigName());
-
- const bool hasCUDA =
- (std::find(closure->Languages.begin(), closure->Languages.end(),
- cuda_lang) != closure->Languages.end());
-
- bool doDeviceLinking = false;
- if (const char* resolveDeviceSymbols =
- genTarget.GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
- doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
- } else {
- switch (genTarget.GetType()) {
- case cmStateEnums::SHARED_LIBRARY:
- case cmStateEnums::MODULE_LIBRARY:
- case cmStateEnums::EXECUTABLE:
- doDeviceLinking = true;
- break;
- default:
- break;
- }
- }
-
- if (!(doDeviceLinking && hasCUDA)) {
+ bool requiresDeviceLinking = requireDeviceLinking(
+ *this->GeneratorTarget, *this->GetLocalGenerator(), this->ConfigName);
+ if (!requiresDeviceLinking) {
return;
}