diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2021-11-08 00:25:33 +0900 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-11-18 12:02:38 -0500 |
commit | 3bb2542535fa2ca1e78195b69c53916a55d322e1 (patch) | |
tree | 807f1bb4f08bdca8360c4f76b0150cefb0490177 /Source/cmCPluginAPI.cxx | |
parent | c46b041a3bcede9447c36de2f3359eb4c17f3f50 (diff) | |
download | cmake-3bb2542535fa2ca1e78195b69c53916a55d322e1.tar.gz |
cmMakefile: Simplify Add*Command and adopt to cmAddCustom*Command
Diffstat (limited to 'Source/cmCPluginAPI.cxx')
-rw-r--r-- | Source/cmCPluginAPI.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 6f44739451..9714e167f2 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -223,9 +223,10 @@ static void CCONV cmAddUtilityCommand(void* arg, const char* utilityName, } // Pass the call to the makefile instance. - std::vector<std::string> no_byproducts; - mf->AddUtilityCommand(utilityName, !all, nullptr, no_byproducts, depends2, - commandLines); + auto cc = cm::make_unique<cmCustomCommand>(); + cc->SetDepends(depends2); + cc->SetCommandLines(commandLines); + mf->AddUtilityCommand(utilityName, !all, std::move(cc)); } static void CCONV cmAddCustomCommand(void* arg, const char* source, @@ -299,10 +300,11 @@ static void CCONV cmAddCustomCommandToOutput(void* arg, const char* output, } // Pass the call to the makefile instance. - const char* no_comment = nullptr; - const char* no_working_dir = nullptr; - mf->AddCustomCommandToOutput(output, depends2, main_dependency, commandLines, - no_comment, no_working_dir); + auto cc = cm::make_unique<cmCustomCommand>(); + cc->SetOutputs(output); + cc->SetDepends(depends2); + cc->SetCommandLines(commandLines); + mf->AddCustomCommandToOutput(main_dependency, std::move(cc)); } static void CCONV cmAddCustomCommandToTarget(void* arg, const char* target, @@ -340,12 +342,9 @@ static void CCONV cmAddCustomCommandToTarget(void* arg, const char* target, } // Pass the call to the makefile instance. - std::vector<std::string> no_byproducts; - std::vector<std::string> no_depends; - const char* no_comment = nullptr; - const char* no_working_dir = nullptr; - mf->AddCustomCommandToTarget(target, no_byproducts, no_depends, commandLines, - cctype, no_comment, no_working_dir); + auto cc = cm::make_unique<cmCustomCommand>(); + cc->SetCommandLines(commandLines); + mf->AddCustomCommandToTarget(target, cctype, std::move(cc)); } static void addLinkLibrary(cmMakefile* mf, std::string const& target, |