diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2022-04-22 16:51:26 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2022-07-22 14:34:45 (GMT) |
commit | 96bc59b1ca01be231347404d178445263687dd22 (patch) | |
tree | d9c015f30a1e43f0d5ded6dc75a638471f085ed6 /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | 1527d48cd0071e3e1737b51db3738f7f76ddbf80 (diff) | |
download | CMake-96bc59b1ca01be231347404d178445263687dd22.zip CMake-96bc59b1ca01be231347404d178445263687dd22.tar.gz CMake-96bc59b1ca01be231347404d178445263687dd22.tar.bz2 |
CUDA: Add Device LTO support for nvcc
Fixes #22200
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 74574f7..54f03b9 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -136,17 +136,11 @@ void cmMakefileExecutableTargetGenerator::WriteNvidiaDeviceExecutableRule( std::vector<std::string> depends; this->AppendLinkDepends(depends, linkLanguage); - // Build a list of compiler flags and linker flags. - std::string langFlags; - std::string linkFlags; - // Add language feature flags. + std::string langFlags; this->LocalGenerator->AddLanguageFlagsForLinking( langFlags, this->GeneratorTarget, linkLanguage, this->GetConfigName()); - // Add device-specific linker flags. - this->GetDeviceLinkFlags(linkFlags, linkLanguage); - // Construct a list of files associated with this executable that // may need to be cleaned. std::vector<std::string> exeCleanFiles; @@ -173,13 +167,20 @@ void cmMakefileExecutableTargetGenerator::WriteNvidiaDeviceExecutableRule( // Set path conversion for link script shells. this->LocalGenerator->SetLinkScriptShell(useLinkScript); - std::unique_ptr<cmLinkLineComputer> linkLineComputer( + std::unique_ptr<cmLinkLineDeviceComputer> linkLineComputer( new cmLinkLineDeviceComputer( this->LocalGenerator, this->LocalGenerator->GetStateSnapshot().GetDirectory())); linkLineComputer->SetForResponse(useResponseFileForLibs); linkLineComputer->SetRelink(relink); + // Create set of linking flags. + std::string linkFlags; + std::string ignored_; + this->LocalGenerator->GetDeviceLinkFlags( + *linkLineComputer, this->GetConfigName(), ignored_, linkFlags, ignored_, + ignored_, this->GeneratorTarget); + // Collect up flags to link in needed libraries. std::string linkLibs; this->CreateLinkLibs( |