diff options
author | Brad King <brad.king@kitware.com> | 2020-10-07 19:19:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-10-08 16:20:33 (GMT) |
commit | 0090a11a42c83897e05b09d5381967f0200d6eb7 (patch) | |
tree | f685e0d08f46388aa3cb07a77a751d1d3964fe6b /Source/cmMakefile.h | |
parent | 26464da5d3919cf0c5a6fc3e34cf143bd65d9938 (diff) | |
download | CMake-0090a11a42c83897e05b09d5381967f0200d6eb7.zip CMake-0090a11a42c83897e05b09d5381967f0200d6eb7.tar.gz CMake-0090a11a42c83897e05b09d5381967f0200d6eb7.tar.bz2 |
cmLocalGenerator: Migrate custom command output lookup from cmMakefile
Since commit 777ceaea94 (cmMakefile: Delay custom command creation,
2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at
generate time. Therefore we do not need to look up what source file
holds the custom command producing a given output until generate time.
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r-- | Source/cmMakefile.h | 80 |
1 files changed, 5 insertions, 75 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index b4d2336..01a9274 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -59,24 +59,6 @@ class cmTestGenerator; class cmVariableWatch; class cmake; -/** Flag if byproducts shall also be considered. */ -enum class cmSourceOutputKind -{ - OutputOnly, - OutputOrByproduct -}; - -/** Target and source file which have a specific output. */ -struct cmSourcesWithOutput -{ - /** Target with byproduct. */ - cmTarget* Target = nullptr; - - /** Source file with output or byproduct. */ - cmSourceFile* Source = nullptr; - bool SourceIsByproduct = false; -}; - /** A type-safe wrapper for a string representing a directory id. */ class cmDirectoryId { @@ -231,19 +213,6 @@ public: const cmCustomCommandLines& commandLines); /** - * Add target byproducts. - */ - void AddTargetByproducts(cmTarget* target, - const std::vector<std::string>& byproducts); - - /** - * Add source file outputs. - */ - void AddSourceOutputs(cmSourceFile* source, - const std::vector<std::string>& outputs, - const std::vector<std::string>& byproducts); - - /** * Add a define flag to the build. */ void AddDefineFlag(std::string const& definition); @@ -753,20 +722,10 @@ public: return this->SourceFiles; } - /** - * Return the target if the provided source name is a byproduct of a utility - * target or a PRE_BUILD, PRE_LINK, or POST_BUILD command. - * Return the source file which has the provided source name as output. - */ - cmSourcesWithOutput GetSourcesWithOutput(const std::string& name) const; - - /** - * Is there a source file that has the provided source name as an output? - * If so then return it. - */ - cmSourceFile* GetSourceFileWithOutput( - const std::string& name, - cmSourceOutputKind kind = cmSourceOutputKind::OutputOnly) const; + std::vector<cmTarget*> const& GetOrderedTargets() const + { + return this->OrderedTargets; + } //! Add a new cmTest to the list of tests for this makefile. cmTest* CreateTest(const std::string& testName); @@ -983,8 +942,7 @@ protected: mutable cmTargetMap Targets; std::map<std::string, std::string> AliasTargets; - using TargetsVec = std::vector<cmTarget*>; - TargetsVec OrderedTargets; + std::vector<cmTarget*> OrderedTargets; std::vector<std::unique_ptr<cmSourceFile>> SourceFiles; @@ -1134,34 +1092,6 @@ private: std::vector<BT<GeneratorAction>> GeneratorActions; bool GeneratorActionsInvoked = false; - /** - * See LinearGetSourceFileWithOutput for background information - */ - cmTarget* LinearGetTargetWithOutput(const std::string& name) const; - - /** - * Generalized old version of GetSourceFileWithOutput kept for - * backward-compatibility. It implements a linear search and supports - * relative file paths. It is used as a fall back by GetSourceFileWithOutput - * and GetSourcesWithOutput. - */ - cmSourceFile* LinearGetSourceFileWithOutput(const std::string& name, - cmSourceOutputKind kind, - bool& byproduct) const; - - struct SourceEntry - { - cmSourcesWithOutput Sources; - }; - - // A map for fast output to input look up. - using OutputToSourceMap = std::unordered_map<std::string, SourceEntry>; - OutputToSourceMap OutputToSource; - - void UpdateOutputToSourceMap(std::string const& byproduct, cmTarget* target); - void UpdateOutputToSourceMap(std::string const& output, cmSourceFile* source, - bool byproduct); - bool CheckSystemVars; bool CheckCMP0000; std::set<std::string> WarnedCMP0074; |