summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-05-30 11:23:06 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-05-30 16:38:14 (GMT)
commit0d0cb136fb19d96f857f8d7da918e18038d5b627 (patch)
tree5580a7ca5d76063c12b76b25f9e05614d3260149 /Source
parent09c21914b320567583ce5ff4c92e56b8a54bf3cb (diff)
downloadCMake-0d0cb136fb19d96f857f8d7da918e18038d5b627.zip
CMake-0d0cb136fb19d96f857f8d7da918e18038d5b627.tar.gz
CMake-0d0cb136fb19d96f857f8d7da918e18038d5b627.tar.bz2
Ninja: Use cmNinjaBuild instead of WritePhonyBuild
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 9d05110..1225cbd 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -19,6 +19,7 @@
#include <array>
#include <iterator>
#include <string>
+#include <utility>
#include <vector>
cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
@@ -41,8 +42,9 @@ void cmNinjaUtilityTargetGenerator::Generate()
utilCommandName += this->GetTargetName() + ".util";
utilCommandName = this->ConvertToNinjaPath(utilCommandName);
+ cmNinjaBuild phonyBuild("phony");
std::vector<std::string> commands;
- cmNinjaDeps deps, outputs, util_outputs(1, utilCommandName);
+ cmNinjaDeps deps, util_outputs(1, utilCommandName);
bool uses_terminal = false;
{
@@ -86,13 +88,13 @@ void cmNinjaUtilityTargetGenerator::Generate()
}
}
- lg->AppendTargetOutputs(genTarget, outputs);
+ lg->AppendTargetOutputs(genTarget, phonyBuild.Outputs);
lg->AppendTargetDepends(genTarget, deps);
if (commands.empty()) {
- gg->WritePhonyBuild(this->GetBuildFileStream(),
- "Utility command for " + this->GetTargetName(),
- outputs, deps);
+ phonyBuild.Comment = "Utility command for " + this->GetTargetName();
+ phonyBuild.ExplicitDeps = std::move(deps);
+ gg->WriteBuild(this->GetBuildFileStream(), phonyBuild);
} else {
std::string command =
lg->BuildCommandLine(commands, "utility", this->GeneratorTarget);
@@ -129,8 +131,8 @@ void cmNinjaUtilityTargetGenerator::Generate()
/*depfile*/ "", /*job_pool*/ "", uses_terminal,
/*restat*/ true, util_outputs, deps);
- gg->WritePhonyBuild(this->GetBuildFileStream(), "", outputs,
- cmNinjaDeps(1, utilCommandName));
+ phonyBuild.ExplicitDeps.push_back(utilCommandName);
+ gg->WriteBuild(this->GetBuildFileStream(), phonyBuild);
}
// Add an alias for the logical target name regardless of what directory