Strange errors while build examples with CXX_MODULEs on main branch

somethings goes wrong on master within Ninja Generator!

snipped of git diff v4.0.2 Source/cmNinjaTargetGenerator.cxx:

diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 8d936525b0..ac87c0d32b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -490,38 +478,20 @@ std::string cmNinjaTargetGenerator::GetPreprocessedFilePath(
   std::string const ppName =
     cmStrCat(objName.substr(0, objName.size() - objExt.size()), "-pp.", ppExt);
 
-  std::string path = this->LocalGenerator->GetHomeRelativeOutputPath();
-  if (!path.empty()) {
-    path += '/';
-  }
-  path +=
-    cmStrCat(this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
-             this->GetGlobalGenerator()->ConfigDirectory(config), '/', ppName);
-  return path;
+  return cmStrCat(this->GetObjectFileDir(config), '/', ppName);
 }
 
 std::string cmNinjaTargetGenerator::GetDyndepFilePath(
   std::string const& lang, std::string const& config) const
 {
-  std::string path = this->LocalGenerator->GetHomeRelativeOutputPath();
-  if (!path.empty()) {
-    path += '/';
-  }
-  path += cmStrCat(
-    this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
-    this->GetGlobalGenerator()->ConfigDirectory(config), '/', lang, ".dd");
-  return path;
+  return cmStrCat(this->GetObjectFileDir(config), '/', lang, ".dd");
 }
 
 std::string cmNinjaTargetGenerator::GetTargetDependInfoPath(
   std::string const& lang, std::string const& config) const
 {
-  std::string path =
-    cmStrCat(this->Makefile->GetCurrentBinaryDirectory(), '/',
-             this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
-             this->GetGlobalGenerator()->ConfigDirectory(config), '/', lang,
-             "DependInfo.json");
-  return path;
+  return cmStrCat(this->GetObjectFileDir(config), '/', lang,
+                  "DependInfo.json");
 }
 
 std::string cmNinjaTargetGenerator::GetTargetOutputDir(
``