Browse Source

cmNinjaTargetGenerator: fix DependInfo.json generation location

Commit aafd771529 (cmNinjaTargetGenerator: use `GetObjectFileDir` where
possible, 2025-05-21) from !10812 accidentally converted the
`GetTargetDependInfoPath` from an always-absolute path to a
relative-for-ninja path. This works fine as everything ended up doing
`ConvertToNinjaPath` as necessary *except* the code which actually wrote
the file. That needs an absolute path in order to generate it in the
correct location.

Fixes: #26983
Ben Boeckel 5 months ago
parent
commit
a16566105b
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Source/cmNinjaTargetGenerator.cxx

+ 3 - 2
Source/cmNinjaTargetGenerator.cxx

@@ -490,8 +490,9 @@ std::string cmNinjaTargetGenerator::GetDyndepFilePath(
 std::string cmNinjaTargetGenerator::GetTargetDependInfoPath(
   std::string const& lang, std::string const& config) const
 {
-  return cmStrCat(this->GetObjectFileDir(config), '/', lang,
-                  "DependInfo.json");
+  return cmStrCat(this->GeneratorTarget->GetSupportDirectory(),
+                  this->GetGlobalGenerator()->ConfigDirectory(config), '/',
+                  lang, "DependInfo.json");
 }
 
 std::string cmNinjaTargetGenerator::GetTargetOutputDir(