fileapi: Do not expose flags for linker-generated dependencies

In commit 375e6fdbbe (Link step: use linker dependency linker file,
2023-04-19, v3.27.0-rc1~126^2) we added the `-Wl,--dependency-file,...`
flag for the Ninja generator in a code path shared with the file-api.
This flag is a build system implementation detail and should not be
exposed to file-api clients.  Move it to a Ninja-specific code path.

Fixes: #26498
This commit is contained in:
Brad King
2024-12-03 13:43:37 -05:00
parent 50afcb61f7
commit 1a04515a47
2 changed files with 3 additions and 2 deletions

View File

@@ -1626,8 +1626,6 @@ void cmLocalGenerator::GetTargetFlags(
this->AppendPositionIndependentLinkerFlags(extraLinkFlags, target, config,
linkLanguage);
this->AppendIPOLinkerFlags(extraLinkFlags, target, config, linkLanguage);
this->AppendDependencyInfoLinkerFlags(extraLinkFlags, target, config,
linkLanguage);
this->AppendModuleDefinitionFlag(extraLinkFlags, target, linkLineComputer,
config);

View File

@@ -1277,6 +1277,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
vars["LINK_LIBRARIES"], vars["FLAGS"],
vars["LINK_FLAGS"], frameworkPath, linkPath, gt);
localGen.AppendDependencyInfoLinkerFlags(vars["LINK_FLAGS"], gt, config,
this->TargetLinkLanguage(config));
// Add OS X version flags, if any.
if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) {