mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 22:31:18 -05:00
CUDA: Avoid unnecessary allocation and GetLinkLanguage()
There's no reason to allocate the cmNinjaLinkLineDeviceComputer on the heap. We can also assume the link language as CUDA in cmLocalGenerator::GetDeviceLinkFlags().
This commit is contained in:
@@ -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());
|
||||
cmNinjaLinkLineDeviceComputer linkLineComputer(
|
||||
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);
|
||||
localGen.GetDeviceLinkFlags(linkLineComputer, config, vars["LINK_LIBRARIES"],
|
||||
vars["LINK_FLAGS"], frameworkPath, linkPath,
|
||||
genTarget);
|
||||
|
||||
this->addPoolNinjaVariable("JOB_POOL_LINK", genTarget, vars);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user