瀏覽代碼

generators: use `GetObjectOutputRoot` to compute target directories

In a coming change to shorten directory paths, this allows one place to
decide how to compute the target path root.
Ben Boeckel 7 月之前
父節點
當前提交
bc19e42461
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      Source/cmExtraEclipseCDT4Generator.cxx
  2. 1 1
      Source/cmGeneratorTarget.cxx
  3. 1 1
      Source/cmLocalNinjaGenerator.cxx

+ 2 - 2
Source/cmExtraEclipseCDT4Generator.cxx

@@ -972,8 +972,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
               xml, "Build", make, buildArgs, virtDir, "", targetName.c_str());
 
             std::string cleanArgs =
-              cmStrCat("-E chdir \"", lgen->GetCurrentBinaryDirectory(),
-                       "\" \"", cmSystemTools::GetCMakeCommand(), "\" -P \"");
+              cmStrCat("-E chdir \"", lgen->GetObjectOutputRoot(), "\" \"",
+                       cmSystemTools::GetCMakeCommand(), "\" -P \"");
             cleanArgs += lgen->GetTargetDirectory(target.get());
             cleanArgs += "/cmake_clean.cmake\"";
             cmExtraEclipseCDT4Generator::AppendTarget(

+ 1 - 1
Source/cmGeneratorTarget.cxx

@@ -5218,7 +5218,7 @@ bool cmGeneratorTarget::NeedImportLibraryName(std::string const& config) const
 std::string cmGeneratorTarget::GetSupportDirectory() const
 {
   cmLocalGenerator* lg = this->GetLocalGenerator();
-  return cmStrCat(lg->GetCurrentBinaryDirectory(), '/',
+  return cmStrCat(lg->GetObjectOutputRoot(), '/',
                   lg->GetTargetDirectory(this));
 }
 

+ 1 - 1
Source/cmLocalNinjaGenerator.cxx

@@ -75,7 +75,7 @@ void cmLocalNinjaGenerator::Generate()
   // Compute the path to use when referencing the current output
   // directory from the top output directory.
   this->HomeRelativeOutputPath =
-    this->MaybeRelativeToTopBinDir(this->GetCurrentBinaryDirectory());
+    this->MaybeRelativeToTopBinDir(this->GetObjectOutputRoot());
   if (this->HomeRelativeOutputPath == ".") {
     this->HomeRelativeOutputPath.clear();
   }