Browse Source

cmDepends: Remove attempt to change directory that always fails

Nothing ever set `CompileDirectory` except `SetDirectory()`, but
nothing ever called that function. Therefore, `CompileDirectory`
was always empty for the attempt to change directory in `Check()`,
which therefore would always fail. Nothing was checking the result
and the code was always going to have no effect.
Craig Scott 7 years ago
parent
commit
5901699672
2 changed files with 1 additions and 12 deletions
  1. 1 6
      Source/cmDepends.cxx
  2. 0 6
      Source/cmDepends.h

+ 1 - 6
Source/cmDepends.cxx

@@ -7,7 +7,6 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmSystemTools.h"
-#include "cmWorkingDirectory.h"
 
 #include "cmsys/FStream.hxx"
 #include <sstream>
@@ -15,8 +14,7 @@
 #include <utility>
 
 cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
-  : CompileDirectory()
-  , LocalGenerator(lg)
+  : LocalGenerator(lg)
   , Verbose(false)
   , FileComparison(nullptr)
   , TargetDirectory(targetDir)
@@ -73,9 +71,6 @@ bool cmDepends::Finalize(std::ostream& /*unused*/, std::ostream& /*unused*/)
 bool cmDepends::Check(const char* makeFile, const char* internalFile,
                       std::map<std::string, DependencyVector>& validDeps)
 {
-  // Dependency checks must be done in proper working directory.
-  cmWorkingDirectory workdir(this->CompileDirectory);
-
   // Check whether dependencies must be regenerated.
   bool okay = true;
   cmsys::ifstream fin(internalFile);

+ 0 - 6
Source/cmDepends.h

@@ -31,9 +31,6 @@ public:
       path from the build directory to the target file.  */
   cmDepends(cmLocalGenerator* lg = nullptr, const char* targetDir = "");
 
-  /** at what level will the compile be done from */
-  void SetCompileDirectory(const char* dir) { this->CompileDirectory = dir; }
-
   /** Set the local generator for the directory in which we are
       scanning dependencies.  This is not a full local generator; it
       has been setup to do relative path conversions for the current
@@ -95,9 +92,6 @@ protected:
   virtual bool Finalize(std::ostream& makeDepends,
                         std::ostream& internalDepends);
 
-  // The directory in which the build rule for the target file is executed.
-  std::string CompileDirectory;
-
   // The local generator.
   cmLocalGenerator* LocalGenerator;