summaryrefslogtreecommitdiffstats
path: root/Source/cmLinkLineDeviceComputer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLinkLineDeviceComputer.cxx')
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index 6cfe5bb..8d2add6 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -12,6 +12,7 @@
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
#include "cmGeneratorTarget.h"
+#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
@@ -89,12 +90,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;
@@ -142,6 +148,9 @@ std::string cmLinkLineDeviceComputer::GetLinkerLanguage(cmGeneratorTarget*,
bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
const std::string& config)
{
+ if (!target.GetGlobalGenerator()->GetLanguageEnabled("CUDA")) {
+ return false;
+ }
if (target.GetType() == cmStateEnums::OBJECT_LIBRARY) {
return false;