1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-20 04:24:36 +08:00

cmDepends: Update types to always use a Makefile generator

We only use these classes with a `cmLocalUnixMakefileGenerator3`.
Construct using that type instead of just `cmLocalGenerator` so
that the Makefile-specific methods are available.
This commit is contained in:
Brad King
2020-04-10 11:30:24 -04:00
parent 413d26030f
commit 1639ee70ef
6 changed files with 20 additions and 15 deletions

View File

@@ -9,12 +9,12 @@
#include "cmFileTime.h" #include "cmFileTime.h"
#include "cmFileTimeCache.h" #include "cmFileTimeCache.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmLocalGenerator.h" #include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
cmDepends::cmDepends(cmLocalGenerator* lg, std::string targetDir) cmDepends::cmDepends(cmLocalUnixMakefileGenerator3* lg, std::string targetDir)
: LocalGenerator(lg) : LocalGenerator(lg)
, TargetDirectory(std::move(targetDir)) , TargetDirectory(std::move(targetDir))
{ {

View File

@@ -12,7 +12,7 @@
#include <vector> #include <vector>
class cmFileTimeCache; class cmFileTimeCache;
class cmLocalGenerator; class cmLocalUnixMakefileGenerator3;
/** \class cmDepends /** \class cmDepends
* \brief Dependency scanner superclass. * \brief Dependency scanner superclass.
@@ -29,7 +29,8 @@ public:
public: public:
/** Instances need to know the build directory name and the relative /** Instances need to know the build directory name and the relative
path from the build directory to the target file. */ path from the build directory to the target file. */
cmDepends(cmLocalGenerator* lg = nullptr, std::string targetDir = ""); cmDepends(cmLocalUnixMakefileGenerator3* lg = nullptr,
std::string targetDir = "");
cmDepends(cmDepends const&) = delete; cmDepends(cmDepends const&) = delete;
cmDepends& operator=(cmDepends const&) = delete; cmDepends& operator=(cmDepends const&) = delete;
@@ -38,7 +39,10 @@ public:
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
directory. */ directory. */
void SetLocalGenerator(cmLocalGenerator* lg) { this->LocalGenerator = lg; } void SetLocalGenerator(cmLocalUnixMakefileGenerator3* lg)
{
this->LocalGenerator = lg;
}
/** Set the specific language to be scanned. */ /** Set the specific language to be scanned. */
void SetLanguage(const std::string& lang) { this->Language = lang; } void SetLanguage(const std::string& lang) { this->Language = lang; }
@@ -92,7 +96,7 @@ protected:
std::ostream& internalDepends); std::ostream& internalDepends);
// The local generator. // The local generator.
cmLocalGenerator* LocalGenerator; cmLocalUnixMakefileGenerator3* LocalGenerator;
// Flag for verbose output. // Flag for verbose output.
bool Verbose = false; bool Verbose = false;

View File

@@ -7,7 +7,7 @@
#include "cmsys/FStream.hxx" #include "cmsys/FStream.hxx"
#include "cmFileTime.h" #include "cmFileTime.h"
#include "cmLocalGenerator.h" #include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -22,8 +22,9 @@
cmDependsC::cmDependsC() = default; cmDependsC::cmDependsC() = default;
cmDependsC::cmDependsC(cmLocalGenerator* lg, const std::string& targetDir, cmDependsC::cmDependsC(cmLocalUnixMakefileGenerator3* lg,
const std::string& lang, const DependencyMap* validDeps) const std::string& targetDir, const std::string& lang,
const DependencyMap* validDeps)
: cmDepends(lg, targetDir) : cmDepends(lg, targetDir)
, ValidDeps(validDeps) , ValidDeps(validDeps)
{ {

View File

@@ -16,7 +16,7 @@
#include "cmDepends.h" #include "cmDepends.h"
class cmLocalGenerator; class cmLocalUnixMakefileGenerator3;
/** \class cmDependsC /** \class cmDependsC
* \brief Dependency scanner for C and C++ object files. * \brief Dependency scanner for C and C++ object files.
@@ -27,7 +27,7 @@ public:
/** Checking instances need to know the build directory name and the /** Checking instances need to know the build directory name and the
relative path from the build directory to the target file. */ relative path from the build directory to the target file. */
cmDependsC(); cmDependsC();
cmDependsC(cmLocalGenerator* lg, const std::string& targetDir, cmDependsC(cmLocalUnixMakefileGenerator3* lg, const std::string& targetDir,
const std::string& lang, const DependencyMap* validDeps); const std::string& lang, const DependencyMap* validDeps);
/** Virtual destructor to cleanup subclasses properly. */ /** Virtual destructor to cleanup subclasses properly. */

View File

@@ -12,7 +12,7 @@
#include "cmFortranParser.h" /* Interface to parser object. */ #include "cmFortranParser.h" /* Interface to parser object. */
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmLocalGenerator.h" #include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmOutputConverter.h" #include "cmOutputConverter.h"
#include "cmStateDirectory.h" #include "cmStateDirectory.h"
@@ -72,7 +72,7 @@ public:
cmDependsFortran::cmDependsFortran() = default; cmDependsFortran::cmDependsFortran() = default;
cmDependsFortran::cmDependsFortran(cmLocalGenerator* lg) cmDependsFortran::cmDependsFortran(cmLocalUnixMakefileGenerator3* lg)
: cmDepends(lg) : cmDepends(lg)
, Internal(new cmDependsFortranInternals) , Internal(new cmDependsFortranInternals)
{ {

View File

@@ -15,7 +15,7 @@
class cmDependsFortranInternals; class cmDependsFortranInternals;
class cmFortranSourceInfo; class cmFortranSourceInfo;
class cmLocalGenerator; class cmLocalUnixMakefileGenerator3;
/** \class cmDependsFortran /** \class cmDependsFortran
* \brief Dependency scanner for Fortran object files. * \brief Dependency scanner for Fortran object files.
@@ -31,7 +31,7 @@ public:
path from the build directory to the target file, the source path from the build directory to the target file, the source
file from which to start scanning, the include file search file from which to start scanning, the include file search
path, and the target directory. */ path, and the target directory. */
cmDependsFortran(cmLocalGenerator* lg); cmDependsFortran(cmLocalUnixMakefileGenerator3* lg);
/** Virtual destructor to cleanup subclasses properly. */ /** Virtual destructor to cleanup subclasses properly. */
~cmDependsFortran() override; ~cmDependsFortran() override;