summaryrefslogtreecommitdiff
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2021-11-07 12:45:49 +0900
committerBrad King <brad.king@kitware.com>2021-11-18 12:02:38 -0500
commitc46b041a3bcede9447c36de2f3359eb4c17f3f50 (patch)
tree6940fb1d08650b7451916dcf65a3414a15663ca9 /Source/cmLocalVisualStudio7Generator.cxx
parent68b4e3b255be7a8d0831d19b206f701efdb001c8 (diff)
downloadcmake-c46b041a3bcede9447c36de2f3359eb4c17f3f50.tar.gz
cmLocalGenerator: Simplify Add{Custom,Utility}Command
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7223049635..886a4e8fc9 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -110,7 +110,6 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
const auto& tgts = this->GetGeneratorTargets();
for (auto& l : tgts) {
if (l->GetType() == cmStateEnums::GLOBAL_TARGET) {
- std::vector<std::string> no_depends;
cmCustomCommandLines force_commands =
cmMakeSingleCommandLine({ "cd", "." });
std::string no_main_dependency;
@@ -120,9 +119,13 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
this->Makefile->GetOrCreateGeneratedSource(force)) {
sf->SetProperty("SYMBOLIC", "1");
}
+ auto cc = cm::make_unique<cmCustomCommand>();
+ cc->SetOutputs(force);
+ cc->SetCommandLines(force_commands);
+ cc->SetComment(" ");
+ cc->SetCMP0116Status(cmPolicies::NEW);
if (cmSourceFile* file = this->AddCustomCommandToOutput(
- force, no_depends, no_main_dependency, force_commands, " ",
- nullptr, cmPolicies::NEW, true)) {
+ no_main_dependency, std::move(cc), true)) {
l->AddSource(file->ResolveFullPath());
}
}
@@ -240,16 +243,19 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
std::string argB = cmStrCat("-B", this->GetBinaryDirectory());
std::string stampName =
cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles/generate.stamp");
- bool stdPipesUTF8 = true;
cmCustomCommandLines commandLines =
cmMakeSingleCommandLine({ cmSystemTools::GetCMakeCommand(), argS, argB,
"--check-stamp-file", stampName });
std::string comment = cmStrCat("Building Custom Rule ", makefileIn);
- const char* no_working_directory = nullptr;
- this->AddCustomCommandToOutput(stampName, listFiles, makefileIn,
- commandLines, comment.c_str(),
- no_working_directory, cmPolicies::NEW, true,
- false, false, false, "", "", stdPipesUTF8);
+ auto cc = cm::make_unique<cmCustomCommand>();
+ cc->SetOutputs(stampName);
+ cc->SetDepends(listFiles);
+ cc->SetCommandLines(commandLines);
+ cc->SetComment(comment.c_str());
+ cc->SetCMP0116Status(cmPolicies::NEW);
+ cc->SetEscapeOldStyle(false);
+ cc->SetStdPipesUTF8(true);
+ this->AddCustomCommandToOutput(makefileIn, std::move(cc), true);
if (cmSourceFile* file = this->Makefile->GetSource(makefileIn)) {
// Finalize the source file path now since we're adding this after
// the generator validated all project-named sources.