diff options
author | Raul Tambre <raul@tambre.ee> | 2021-11-06 11:35:04 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2021-11-07 19:28:08 (GMT) |
commit | cf7e68087d005051ec07cb21c2aed2963a3d5c4e (patch) | |
tree | 67869490366e8f5b2a448100581e494f3f5d07e3 /Source/cmLocalGenerator.cxx | |
parent | 5b0693411ef53349f192140b855ec1cdc148f3b9 (diff) | |
download | CMake-cf7e68087d005051ec07cb21c2aed2963a3d5c4e.zip CMake-cf7e68087d005051ec07cb21c2aed2963a3d5c4e.tar.gz CMake-cf7e68087d005051ec07cb21c2aed2963a3d5c4e.tar.bz2 |
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().
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 8 |
1 files changed, 3 insertions, 5 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); } |