Commit 59016996 authored by Craig Scott's avatar Craig Scott

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.
parent e60e4dfc
......@@ -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);
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment