diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2021-11-14 08:22:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-11-18 17:02:37 (GMT) |
commit | e37511ae7eb68a46fb9edb9f00d3fc179f713e45 (patch) | |
tree | 98bde246d5424c4552bb1b0149f96449d948bd86 /Source/cmLocalGenerator.h | |
parent | 90e1206f253c0acbef37668403133585a31b2a92 (diff) | |
download | CMake-e37511ae7eb68a46fb9edb9f00d3fc179f713e45.zip CMake-e37511ae7eb68a46fb9edb9f00d3fc179f713e45.tar.gz CMake-e37511ae7eb68a46fb9edb9f00d3fc179f713e45.tar.bz2 |
cmMakefile: Simplify detail:::Add{Custom,Utility}Command
Note 1: `detail::AddCustomCommandToTarget()` resets cc,
since cc is not moved away.
Note 2: In `detail::AddUtilityCommand()`, a few vars are preserved
before using. Their refs will be alive in most cases, but cc might
be destroyed in the future.
Diffstat (limited to 'Source/cmLocalGenerator.h')
-rw-r--r-- | Source/cmLocalGenerator.h | 45 |
1 files changed, 11 insertions, 34 deletions
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 726817a..1304d81 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -713,30 +713,15 @@ bool cmLocalGeneratorCheckObjectName(std::string& objName, #endif namespace detail { -void AddCustomCommandToTarget(cmLocalGenerator& lg, - const cmListFileBacktrace& lfbt, - cmCommandOrigin origin, cmTarget* target, - const std::vector<std::string>& byproducts, - const std::vector<std::string>& depends, - const cmCustomCommandLines& commandLines, - cmCustomCommandType 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, bool stdPipesUTF8, - cmPolicies::PolicyStatus cmp0116); - -cmSourceFile* AddCustomCommandToOutput( - cmLocalGenerator& lg, const cmListFileBacktrace& lfbt, - cmCommandOrigin origin, 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, bool escapeOldStyle, - bool uses_terminal, bool command_expand_lists, const std::string& depfile, - const std::string& job_pool, bool stdPipesUTF8, - cmPolicies::PolicyStatus cmp0116); +void AddCustomCommandToTarget(cmLocalGenerator& lg, cmCommandOrigin origin, + cmTarget* target, cmCustomCommandType type, + std::unique_ptr<cmCustomCommand> cc); + +cmSourceFile* AddCustomCommandToOutput(cmLocalGenerator& lg, + cmCommandOrigin origin, + const std::string& main_dependency, + std::unique_ptr<cmCustomCommand> cc, + bool replace); void AppendCustomCommandToOutput(cmLocalGenerator& lg, const cmListFileBacktrace& lfbt, @@ -745,16 +730,8 @@ void AppendCustomCommandToOutput(cmLocalGenerator& lg, const cmImplicitDependsList& implicit_depends, const cmCustomCommandLines& commandLines); -void AddUtilityCommand(cmLocalGenerator& lg, const cmListFileBacktrace& lfbt, - cmCommandOrigin origin, cmTarget* target, - const char* workingDir, - 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, bool stdPipesUTF8, - cmPolicies::PolicyStatus cmp0116); +void AddUtilityCommand(cmLocalGenerator& lg, cmCommandOrigin origin, + cmTarget* target, std::unique_ptr<cmCustomCommand> cc); std::vector<std::string> ComputeISPCObjectSuffixes(cmGeneratorTarget* target); std::vector<std::string> ComputeISPCExtraObjects( |