mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 02:17:27 +08:00
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.
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
#include "cmSystemTools.h"
|
#include "cmSystemTools.h"
|
||||||
#include "cmWorkingDirectory.h"
|
|
||||||
|
|
||||||
#include "cmsys/FStream.hxx"
|
#include "cmsys/FStream.hxx"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -15,8 +14,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
|
cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
|
||||||
: CompileDirectory()
|
: LocalGenerator(lg)
|
||||||
, LocalGenerator(lg)
|
|
||||||
, Verbose(false)
|
, Verbose(false)
|
||||||
, FileComparison(nullptr)
|
, FileComparison(nullptr)
|
||||||
, TargetDirectory(targetDir)
|
, TargetDirectory(targetDir)
|
||||||
@@ -73,9 +71,6 @@ bool cmDepends::Finalize(std::ostream& /*unused*/, std::ostream& /*unused*/)
|
|||||||
bool cmDepends::Check(const char* makeFile, const char* internalFile,
|
bool cmDepends::Check(const char* makeFile, const char* internalFile,
|
||||||
std::map<std::string, DependencyVector>& validDeps)
|
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.
|
// Check whether dependencies must be regenerated.
|
||||||
bool okay = true;
|
bool okay = true;
|
||||||
cmsys::ifstream fin(internalFile);
|
cmsys::ifstream fin(internalFile);
|
||||||
|
@@ -31,9 +31,6 @@ public:
|
|||||||
path from the build directory to the target file. */
|
path from the build directory to the target file. */
|
||||||
cmDepends(cmLocalGenerator* lg = nullptr, const char* targetDir = "");
|
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
|
/** Set the local generator for the directory in which we are
|
||||||
scanning dependencies. This is not a full local generator; it
|
scanning dependencies. This is not a full local generator; it
|
||||||
has been setup to do relative path conversions for the current
|
has been setup to do relative path conversions for the current
|
||||||
@@ -95,9 +92,6 @@ protected:
|
|||||||
virtual bool Finalize(std::ostream& makeDepends,
|
virtual bool Finalize(std::ostream& makeDepends,
|
||||||
std::ostream& internalDepends);
|
std::ostream& internalDepends);
|
||||||
|
|
||||||
// The directory in which the build rule for the target file is executed.
|
|
||||||
std::string CompileDirectory;
|
|
||||||
|
|
||||||
// The local generator.
|
// The local generator.
|
||||||
cmLocalGenerator* LocalGenerator;
|
cmLocalGenerator* LocalGenerator;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user