diff options
author | Brad King <brad.king@kitware.com> | 2019-05-22 14:29:49 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-22 14:30:00 (GMT) |
commit | fc4cbbc2a5f9f7d38e77c991a88400b29c39f182 (patch) | |
tree | 82f9614ac1585e57dd33dbae87639af927db2613 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | c024e44abea66e37fefe358659d70d8811dd73c8 (diff) | |
parent | 81b4d10d8f421242f9989ff0c2d37a12be66f405 (diff) | |
download | CMake-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.cxx | 30 |
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; } |