diff options
author | Brad King <brad.king@kitware.com> | 2019-09-20 14:22:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-20 14:24:32 (GMT) |
commit | 541e681da26d3f264ad20228b66e6cfdfec83878 (patch) | |
tree | 50aad156a86eca7b4d8f76fef9c785d926957e50 /Source/cmMakefile.h | |
parent | fb8341c35e43d605e4d2ece50dad6428fd9cc45d (diff) | |
parent | 0e1faa28cbd12d400b876f7a21d91aad5a837196 (diff) | |
download | CMake-541e681da26d3f264ad20228b66e6cfdfec83878.zip CMake-541e681da26d3f264ad20228b66e6cfdfec83878.tar.gz CMake-541e681da26d3f264ad20228b66e6cfdfec83878.tar.bz2 |
Merge topic 'split-custom-command-creation'
0e1faa28cb cmMakefile: Separate custom command setup from actual creation
56c204e8eb cmMakefile: Refactor AddCustomCommandOldStyle to be delay friendly
3061dc6ac9 add_custom_command: Add tests for rejecting literal quotes in commands
e893ab94ba cmMakefile: Validate command line for all custom commands
f1e846fdde cmMakefile: Extract custom command validation method
4926ab2454 cmMakefile: Create all generated byproducts as known sources
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3822
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r-- | Source/cmMakefile.h | 54 |
1 files changed, 46 insertions, 8 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 6d695a7..42a769a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -172,7 +172,7 @@ public: }; /** Add a custom command to the build. */ - void AddCustomCommandToTarget( + cmTarget* AddCustomCommandToTarget( const std::string& target, const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, cmTarget::CustomCommandType type, @@ -181,18 +181,18 @@ public: const std::string& job_pool = "", bool command_expand_lists = false, ObjectLibraryCommands objLibraryCommands = RejectObjectLibraryCommands); cmSourceFile* AddCustomCommandToOutput( - const std::vector<std::string>& outputs, - const std::vector<std::string>& byproducts, - const std::vector<std::string>& depends, + const std::string& output, const std::vector<std::string>& depends, const std::string& main_dependency, - const cmImplicitDependsList& implicit_depends, const cmCustomCommandLines& commandLines, const char* comment, const char* workingDir, bool replace = false, bool escapeOldStyle = true, bool uses_terminal = false, bool command_expand_lists = false, const std::string& depfile = "", const std::string& job_pool = ""); cmSourceFile* AddCustomCommandToOutput( - const std::string& output, const std::vector<std::string>& depends, + const std::vector<std::string>& outputs, + const std::vector<std::string>& byproducts, + const std::vector<std::string>& depends, const std::string& main_dependency, + const cmImplicitDependsList& implicit_depends, const cmCustomCommandLines& commandLines, const char* comment, const char* workingDir, bool replace = false, bool escapeOldStyle = true, bool uses_terminal = false, bool command_expand_lists = false, @@ -1059,9 +1059,42 @@ private: bool atOnly, const char* filename, long line, bool replaceAt) const; - void CreateGeneratedSources( + bool ValidateCustomCommand(const cmCustomCommandLines& commandLines) const; + + void CommitCustomCommandToTarget( + cmTarget* target, const std::vector<std::string>& byproducts, + const std::vector<std::string>& depends, + const cmCustomCommandLines& commandLines, cmTarget::CustomCommandType type, + const char* comment, const char* workingDir, bool escapeOldStyle, + bool uses_terminal, const std::string& depfile, + const std::string& job_pool, bool command_expand_lists); + cmSourceFile* CommitCustomCommandToOutput( const std::vector<std::string>& outputs, - cmSourceFileLocationKind kind = cmSourceFileLocationKind::Ambiguous); + const std::vector<std::string>& byproducts, + const std::vector<std::string>& depends, + const std::string& main_dependency, + const cmImplicitDependsList& implicit_depends, + const cmCustomCommandLines& commandLines, const char* comment, + const char* workingDir, bool replace, bool escapeOldStyle, + bool uses_terminal, bool command_expand_lists, const std::string& depfile, + const std::string& job_pool); + void CommitAppendCustomCommandToOutput( + const std::string& output, const std::vector<std::string>& depends, + const cmImplicitDependsList& implicit_depends, + const cmCustomCommandLines& commandLines); + + void CommitUtilityCommand(cmTarget* target, const std::string& force, + const std::string& forceCMP0049, + const char* workingDirectory, + const std::vector<std::string>& byproducts, + const std::vector<std::string>& depends, + const cmCustomCommandLines& commandLines, + bool escapeOldStyle, const char* comment, + bool uses_terminal, bool command_expand_lists, + const std::string& job_pool); + + void CreateGeneratedSource(const std::string& output); + void CreateGeneratedSources(const std::vector<std::string>& outputs); /** * See LinearGetSourceFileWithOutput for background information @@ -1096,6 +1129,11 @@ private: void UpdateOutputToSourceMap(std::string const& output, cmSourceFile* source, bool byproduct); + /** + * Return if the provided source file might have a custom command. + */ + bool MightHaveCustomCommand(const std::string& name) const; + bool AddRequiredTargetCFeature(cmTarget* target, const std::string& feature, std::string* error = nullptr) const; |