diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-19 14:01:10 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2023-05-03 15:08:07 (GMT) |
commit | 375e6fdbbe398921de321216125765ba1917a325 (patch) | |
tree | 43d934f18f4d28a82d5264a0d0fb0301bc0bf7d9 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 24a3e5cda049138ca178216e0d7b02262e4035ed (diff) | |
download | CMake-375e6fdbbe398921de321216125765ba1917a325.zip CMake-375e6fdbbe398921de321216125765ba1917a325.tar.gz CMake-375e6fdbbe398921de321216125765ba1917a325.tar.bz2 |
Link step: use linker dependency linker file
Based on work done by @ben.boeckel (!8051)
Fixes: #22217
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 028066e..9f3894a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -239,6 +239,12 @@ void cmLocalUnixMakefileGenerator3::GetIndividualFileTargets( } } +std::string cmLocalUnixMakefileGenerator3::GetLinkDependencyFile( + cmGeneratorTarget* target, std::string const& /*config*/) const +{ + return cmStrCat(target->GetSupportDirectory(), "/link.d"); +} + void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() { // generate the includes @@ -2008,6 +2014,18 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo( << this->MaybeRelativeToTopBinDir(src) << "\"\n"; } } + } else if (compilerLang.first == "LINK"_s) { + auto depFormat = this->Makefile->GetDefinition( + cmStrCat("CMAKE_", target->GetLinkerLanguage(this->GetConfigName()), + "_LINKER_DEPFILE_FORMAT")); + for (auto const& compilerPair : compilerPairs) { + for (auto const& src : compilerPair.second) { + cmakefileStream << R"( "" ")" + << this->MaybeRelativeToTopBinDir(compilerPair.first) + << "\" \"" << depFormat << "\" \"" + << this->MaybeRelativeToTopBinDir(src) << "\"\n"; + } + } } else { auto depFormat = this->Makefile->GetSafeDefinition( cmStrCat("CMAKE_", compilerLang.first, "_DEPFILE_FORMAT")); |