mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
Refactoring: Makefiles Generators: Add support for various depends scanners
This commit is contained in:
@@ -43,6 +43,13 @@ enum class cmSourceOutputKind
|
|||||||
OutputOrByproduct
|
OutputOrByproduct
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** What scanner to use for dependencies lookup. */
|
||||||
|
enum class cmDependencyScannerKind
|
||||||
|
{
|
||||||
|
CMake,
|
||||||
|
Compiler
|
||||||
|
};
|
||||||
|
|
||||||
/** Target and source file which have a specific output. */
|
/** Target and source file which have a specific output. */
|
||||||
struct cmSourcesWithOutput
|
struct cmSourcesWithOutput
|
||||||
{
|
{
|
||||||
|
@@ -2049,16 +2049,18 @@ std::string cmLocalUnixMakefileGenerator3::GetTargetDirectory(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmLocalUnixMakefileGenerator3::ImplicitDependLanguageMap const&
|
cmLocalUnixMakefileGenerator3::ImplicitDependLanguageMap const&
|
||||||
cmLocalUnixMakefileGenerator3::GetImplicitDepends(const cmGeneratorTarget* tgt)
|
cmLocalUnixMakefileGenerator3::GetImplicitDepends(
|
||||||
|
const cmGeneratorTarget* tgt, cmDependencyScannerKind scanner)
|
||||||
{
|
{
|
||||||
return this->ImplicitDepends[tgt->GetName()];
|
return this->ImplicitDepends[tgt->GetName()][scanner];
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmLocalUnixMakefileGenerator3::AddImplicitDepends(
|
void cmLocalUnixMakefileGenerator3::AddImplicitDepends(
|
||||||
const cmGeneratorTarget* tgt, const std::string& lang,
|
const cmGeneratorTarget* tgt, const std::string& lang,
|
||||||
const std::string& obj, const std::string& src)
|
const std::string& obj, const std::string& src,
|
||||||
|
cmDependencyScannerKind scanner)
|
||||||
{
|
{
|
||||||
this->ImplicitDepends[tgt->GetName()][lang][obj].push_back(src);
|
this->ImplicitDepends[tgt->GetName()][scanner][lang][obj].push_back(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmLocalUnixMakefileGenerator3::CreateCDCommand(
|
void cmLocalUnixMakefileGenerator3::CreateCDCommand(
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "cmDepends.h"
|
#include "cmDepends.h"
|
||||||
#include "cmLocalCommonGenerator.h"
|
#include "cmLocalCommonGenerator.h"
|
||||||
|
#include "cmLocalGenerator.h"
|
||||||
|
|
||||||
class cmCustomCommand;
|
class cmCustomCommand;
|
||||||
class cmCustomCommandGenerator;
|
class cmCustomCommandGenerator;
|
||||||
@@ -152,23 +153,21 @@ public:
|
|||||||
|
|
||||||
// File pairs for implicit dependency scanning. The key of the map
|
// File pairs for implicit dependency scanning. The key of the map
|
||||||
// is the depender and the value is the explicit dependee.
|
// is the depender and the value is the explicit dependee.
|
||||||
struct ImplicitDependFileMap : public cmDepends::DependencyMap
|
using ImplicitDependFileMap = cmDepends::DependencyMap;
|
||||||
{
|
using ImplicitDependLanguageMap =
|
||||||
};
|
std::map<std::string, ImplicitDependFileMap>;
|
||||||
struct ImplicitDependLanguageMap
|
using ImplicitDependScannerMap =
|
||||||
: public std::map<std::string, ImplicitDependFileMap>
|
std::map<cmDependencyScannerKind, ImplicitDependLanguageMap>;
|
||||||
{
|
using ImplicitDependTargetMap =
|
||||||
};
|
std::map<std::string, ImplicitDependScannerMap>;
|
||||||
struct ImplicitDependTargetMap
|
|
||||||
: public std::map<std::string, ImplicitDependLanguageMap>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
ImplicitDependLanguageMap const& GetImplicitDepends(
|
ImplicitDependLanguageMap const& GetImplicitDepends(
|
||||||
cmGeneratorTarget const* tgt);
|
cmGeneratorTarget const* tgt,
|
||||||
|
cmDependencyScannerKind scanner = cmDependencyScannerKind::CMake);
|
||||||
|
|
||||||
void AddImplicitDepends(cmGeneratorTarget const* tgt,
|
void AddImplicitDepends(
|
||||||
const std::string& lang, const std::string& obj,
|
cmGeneratorTarget const* tgt, const std::string& lang,
|
||||||
const std::string& src);
|
const std::string& obj, const std::string& src,
|
||||||
|
cmDependencyScannerKind scanner = cmDependencyScannerKind::CMake);
|
||||||
|
|
||||||
// write the target rules for the local Makefile into the stream
|
// write the target rules for the local Makefile into the stream
|
||||||
void WriteLocalAllRules(std::ostream& ruleFileStream);
|
void WriteLocalAllRules(std::ostream& ruleFileStream);
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include "cmGlobalUnixMakefileGenerator3.h"
|
#include "cmGlobalUnixMakefileGenerator3.h"
|
||||||
#include "cmLinkLineComputer.h" // IWYU pragma: keep
|
#include "cmLinkLineComputer.h" // IWYU pragma: keep
|
||||||
#include "cmLocalCommonGenerator.h"
|
#include "cmLocalCommonGenerator.h"
|
||||||
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmLocalUnixMakefileGenerator3.h"
|
#include "cmLocalUnixMakefileGenerator3.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
#include "cmMakefileExecutableTargetGenerator.h"
|
#include "cmMakefileExecutableTargetGenerator.h"
|
||||||
|
Reference in New Issue
Block a user