summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmLocalGenerator.cxx8
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx18
3 files changed, 12 insertions, 16 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3a4c386..970e30b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1410,25 +1410,23 @@ std::vector<BT<std::string>> cmLocalGenerator::GetStaticLibraryFlags(
}
void cmLocalGenerator::GetDeviceLinkFlags(
- cmLinkLineComputer* linkLineComputer, const std::string& config,
+ cmLinkLineComputer& linkLineComputer, const std::string& config,
std::string& linkLibs, std::string& linkFlags, std::string& frameworkPath,
std::string& linkPath, cmGeneratorTarget* target)
{
cmGeneratorTarget::DeviceLinkSetter setter(*target);
cmComputeLinkInformation* pcli = target->GetLinkInformation(config);
- const std::string linkLanguage =
- linkLineComputer->GetLinkerLanguage(target, config);
if (pcli) {
// Compute the required device link libraries when
// resolving gpu lang device symbols
- this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, frameworkPath,
+ this->OutputLinkLibraries(pcli, &linkLineComputer, linkLibs, frameworkPath,
linkPath);
}
std::vector<std::string> linkOpts;
- target->GetLinkOptions(linkOpts, config, linkLanguage);
+ target->GetLinkOptions(linkOpts, config, "CUDA");
// LINK_OPTIONS are escaped.
this->AppendCompileOptions(linkFlags, linkOpts);
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 3614c84..b86c8e8 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -496,7 +496,7 @@ public:
/** Fill out these strings for the given target. Libraries to link,
* flags, and linkflags. */
- void GetDeviceLinkFlags(cmLinkLineComputer* linkLineComputer,
+ void GetDeviceLinkFlags(cmLinkLineComputer& linkLineComputer,
const std::string& config, std::string& linkLibs,
std::string& linkFlags, std::string& frameworkPath,
std::string& linkPath, cmGeneratorTarget* target);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 325692e..228df7f 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -855,16 +855,14 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement(
vars["TARGET_FILE"] =
localGen.ConvertToOutputFormat(output, cmOutputConverter::SHELL);
- std::unique_ptr<cmLinkLineComputer> linkLineComputer(
- new cmNinjaLinkLineDeviceComputer(
- this->GetLocalGenerator(),
- this->GetLocalGenerator()->GetStateSnapshot().GetDirectory(),
- globalGen));
- linkLineComputer->SetUseNinjaMulti(globalGen->IsMultiConfig());
-
- localGen.GetDeviceLinkFlags(linkLineComputer.get(), config,
- vars["LINK_LIBRARIES"], vars["LINK_FLAGS"],
- frameworkPath, linkPath, genTarget);
+ cmNinjaLinkLineDeviceComputer linkLineComputer(
+ this->GetLocalGenerator(),
+ this->GetLocalGenerator()->GetStateSnapshot().GetDirectory(), globalGen);
+ linkLineComputer.SetUseNinjaMulti(globalGen->IsMultiConfig());
+
+ localGen.GetDeviceLinkFlags(linkLineComputer, config, vars["LINK_LIBRARIES"],
+ vars["LINK_FLAGS"], frameworkPath, linkPath,
+ genTarget);
this->addPoolNinjaVariable("JOB_POOL_LINK", genTarget, vars);