summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-23 15:01:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-23 15:01:14 (GMT)
commit9771d231aae5f0858dd74d678a6768f0792597fc (patch)
tree54a0583803fa687fa24a2944132605a4e454ef27 /Source
parent6638fa4ad6740299bfa09f2a86cc70300599046d (diff)
parent8337ed0d731f869823efcacf2460a4efbf74a991 (diff)
downloadCMake-9771d231aae5f0858dd74d678a6768f0792597fc.zip
CMake-9771d231aae5f0858dd74d678a6768f0792597fc.tar.gz
CMake-9771d231aae5f0858dd74d678a6768f0792597fc.tar.bz2
Merge topic 'ninja-multi-default-build-alias'
8337ed0d73 Ninja Multi-Config: Add variable to control aliases in build.ninja 110037369d Refactor: Split Ninja files into impl-<Config>.ninja and build-<Config>.ninja e62a3414f7 Refactor: Move common.ninja into CMakeFiles Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4238
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx174
-rw-r--r--Source/cmGlobalNinjaGenerator.h37
-rw-r--r--Source/cmLocalNinjaGenerator.cxx10
-rw-r--r--Source/cmLocalNinjaGenerator.h2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
-rw-r--r--Source/cmNinjaTargetGenerator.cxx30
-rw-r--r--Source/cmNinjaTargetGenerator.h2
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx2
8 files changed, 195 insertions, 72 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 1f83ec5..0911cd0 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -293,7 +293,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
if (config.empty()) {
this->WriteBuild(*this->GetCommonFileStream(), build);
} else {
- this->WriteBuild(*this->GetConfigFileStream(config), build);
+ this->WriteBuild(*this->GetImplFileStream(config), build);
}
}
@@ -324,7 +324,7 @@ void cmGlobalNinjaGenerator::WriteMacOSXContentBuild(std::string input,
cmNinjaBuild build("COPY_OSX_CONTENT");
build.Outputs.push_back(std::move(output));
build.ExplicitDeps.push_back(std::move(input));
- this->WriteBuild(*this->GetConfigFileStream(config), build);
+ this->WriteBuild(*this->GetImplFileStream(config), build);
}
}
@@ -518,6 +518,7 @@ void cmGlobalNinjaGenerator::Generate()
if (cmSystemTools::GetErrorOccuredFlag()) {
this->RulesFileStream->setstate(std::ios::failbit);
for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) {
+ this->GetImplFileStream(config)->setstate(std::ios::failbit);
this->GetConfigFileStream(config)->setstate(std::ios::failbit);
}
this->GetCommonFileStream()->setstate(std::ios::failbit);
@@ -527,10 +528,6 @@ void cmGlobalNinjaGenerator::Generate()
this->CloseRulesFileStream();
this->CloseBuildFileStreams();
- if (!this->WriteDefaultBuildFile()) {
- return;
- }
-
auto run_ninja_tool = [this](std::vector<char const*> const& args) {
std::vector<std::string> command;
command.push_back(this->NinjaCommand);
@@ -1164,14 +1161,11 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias,
newAliasGlobal.first->second.GeneratorTarget != target) {
newAliasGlobal.first->second.GeneratorTarget = nullptr;
}
- if (config != "all") {
- std::pair<TargetAliasMap::iterator, bool> newAliasConfig =
- this->Configs[config].TargetAliases.insert(
- std::make_pair(outputPath, ta));
- if (newAliasConfig.second &&
- newAliasConfig.first->second.GeneratorTarget != target) {
- newAliasConfig.first->second.GeneratorTarget = nullptr;
- }
+ std::pair<TargetAliasMap::iterator, bool> newAliasConfig =
+ this->Configs[config].TargetAliases.insert(std::make_pair(outputPath, ta));
+ if (newAliasConfig.second &&
+ newAliasConfig.first->second.GeneratorTarget != target) {
+ newAliasConfig.first->second.GeneratorTarget = nullptr;
}
}
@@ -1208,7 +1202,7 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
}
this->WriteBuild(this->EnableCrossConfigBuild()
? os
- : *this->GetConfigFileStream(ta.second.Config),
+ : *this->GetImplFileStream(ta.second.Config),
build);
}
@@ -1233,6 +1227,37 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
this->WriteBuild(*this->GetConfigFileStream(config), build);
}
}
+
+ auto const* defaultConfig = this->GetDefaultBuildAlias();
+ if (defaultConfig) {
+ std::string config = defaultConfig;
+ for (auto const& ta : this->Configs[config].TargetAliases) {
+ // Don't write ambiguous aliases.
+ if (!ta.second.GeneratorTarget) {
+ continue;
+ }
+
+ // Don't write alias if there is a already a custom command with
+ // matching output
+ if (this->HasCustomCommandOutput(ta.first)) {
+ continue;
+ }
+
+ build.Outputs.front() = ta.first;
+ build.ExplicitDeps.clear();
+ if (config == "all") {
+ for (auto const& config2 :
+ this->Makefiles.front()->GetGeneratorConfigs()) {
+ this->AppendTargetOutputs(ta.second.GeneratorTarget,
+ build.ExplicitDeps, config2);
+ }
+ } else {
+ this->AppendTargetOutputs(ta.second.GeneratorTarget,
+ build.ExplicitDeps, config);
+ }
+ this->WriteBuild(*this->GetDefaultFileStream(), build);
+ }
+ }
}
}
@@ -1276,10 +1301,9 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
}
}
// Write target
- this->WriteBuild(this->EnableCrossConfigBuild()
- ? os
- : *this->GetConfigFileStream(config),
- build);
+ this->WriteBuild(
+ this->EnableCrossConfigBuild() ? os : *this->GetImplFileStream(config),
+ build);
}
// Add shortcut target
@@ -1291,6 +1315,16 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
this->ConvertToNinjaPath(currentBinaryDir + "/all");
this->WriteBuild(*this->GetConfigFileStream(config), build);
}
+
+ auto const* defaultConfig = this->GetDefaultBuildAlias();
+ if (defaultConfig) {
+ std::string config = defaultConfig;
+ build.ExplicitDeps = { this->BuildAlias(
+ this->ConvertToNinjaPath(currentBinaryDir + "/all"), config) };
+ build.Outputs.front() =
+ this->ConvertToNinjaPath(currentBinaryDir + "/all");
+ this->WriteBuild(*this->GetDefaultFileStream(), build);
+ }
}
// Add target for all configs
@@ -1442,6 +1476,10 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)
for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) {
this->WriteTargetDefault(*this->GetConfigFileStream(config));
}
+
+ if (this->GetDefaultBuildType()) {
+ this->WriteTargetDefault(*this->GetDefaultFileStream());
+ }
}
void cmGlobalNinjaGenerator::WriteTargetDefault(std::ostream& os)
@@ -1734,9 +1772,10 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
}
if (this->IsMultiConfig()) {
build.Variables["FILE_ARG"] = cmStrCat(
- "-f ", cmGlobalNinjaMultiGenerator::GetNinjaFilename(fileConfig));
+ "-f ",
+ cmGlobalNinjaMultiGenerator::GetNinjaImplFilename(fileConfig));
}
- this->WriteBuild(*this->GetConfigFileStream(fileConfig), build);
+ this->WriteBuild(*this->GetImplFileStream(fileConfig), build);
}
}
@@ -1754,8 +1793,9 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
for (auto const& fileConfig : configs) {
build.Variables["FILE_ARG"] = cmStrCat(
- "-f ", cmGlobalNinjaMultiGenerator::GetNinjaFilename(fileConfig));
- this->WriteBuild(*this->GetConfigFileStream(fileConfig), build);
+ "-f ",
+ cmGlobalNinjaMultiGenerator::GetNinjaImplFilename(fileConfig));
+ this->WriteBuild(*this->GetImplFileStream(fileConfig), build);
}
}
}
@@ -1771,6 +1811,14 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
this->NinjaOutputPath(this->GetCleanTargetName()), config);
this->WriteBuild(*this->GetConfigFileStream(config), build);
}
+
+ auto const* defaultConfig = this->GetDefaultBuildAlias();
+ if (defaultConfig) {
+ std::string config = defaultConfig;
+ build.ExplicitDeps.front() = this->BuildAlias(
+ this->NinjaOutputPath(this->GetCleanTargetName()), config);
+ this->WriteBuild(*this->GetDefaultFileStream(), build);
+ }
}
// Write byproducts
@@ -2311,7 +2359,8 @@ void cmGlobalNinjaGenerator::AppendDirectoryForConfig(
}
}
-const char* cmGlobalNinjaMultiGenerator::NINJA_COMMON_FILE = "common.ninja";
+const char* cmGlobalNinjaMultiGenerator::NINJA_COMMON_FILE =
+ "CMakeFiles/common.ninja";
const char* cmGlobalNinjaMultiGenerator::NINJA_FILE_EXTENSION = ".ninja";
cmGlobalNinjaMultiGenerator::cmGlobalNinjaMultiGenerator(cmake* cm)
@@ -2342,21 +2391,45 @@ bool cmGlobalNinjaMultiGenerator::OpenBuildFileStreams()
return false;
}
+ auto const* defaultConfig = this->GetDefaultBuildType();
+ if (defaultConfig) {
+ if (!this->OpenFileStream(this->DefaultFileStream, NINJA_BUILD_FILE)) {
+ return false;
+ }
+ *this->DefaultFileStream
+ << "# This file is a convenience file generated by\n"
+ << "# CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE.\n\n"
+ << "include " << GetNinjaImplFilename(defaultConfig) << "\n\n";
+ }
+
// Write a comment about this file.
*this->CommonFileStream
<< "# This file contains build statements common to all "
"configurations.\n\n";
for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) {
- if (!this->OpenFileStream(this->ConfigFileStreams[config],
- GetNinjaFilename(config))) {
+ // Open impl file.
+ if (!this->OpenFileStream(this->ImplFileStreams[config],
+ GetNinjaImplFilename(config))) {
return false;
}
// Write a comment about this file.
- *this->ConfigFileStreams[config]
+ *this->ImplFileStreams[config]
<< "# This file contains build statements specific to the \"" << config
<< "\"\n# configuration.\n\n";
+
+ // Open config file.
+ if (!this->OpenFileStream(this->ConfigFileStreams[config],
+ GetNinjaConfigFilename(config))) {
+ return false;
+ }
+
+ // Write a comment about this file.
+ *this->ConfigFileStreams[config]
+ << "# This file contains aliases specific to the \"" << config
+ << "\"\n# configuration.\n\n"
+ << "include " << GetNinjaImplFilename(config) << "\n\n";
}
return true;
@@ -2370,7 +2443,17 @@ void cmGlobalNinjaMultiGenerator::CloseBuildFileStreams()
cmSystemTools::Error("Common file stream was not open.");
}
+ if (this->DefaultFileStream) {
+ this->DefaultFileStream.reset();
+ } // No error if it wasn't open
+
for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) {
+ if (this->ImplFileStreams[config]) {
+ this->ImplFileStreams[config].reset();
+ } else {
+ cmSystemTools::Error(
+ cmStrCat("Impl file stream for \"", config, "\" was not open."));
+ }
if (this->ConfigFileStreams[config]) {
this->ConfigFileStreams[config].reset();
} else {
@@ -2384,10 +2467,17 @@ void cmGlobalNinjaMultiGenerator::AppendNinjaFileArgument(
GeneratedMakeCommand& command, const std::string& config) const
{
command.Add("-f");
- command.Add(GetNinjaFilename(config));
+ command.Add(GetNinjaConfigFilename(config));
+}
+
+std::string cmGlobalNinjaMultiGenerator::GetNinjaImplFilename(
+ const std::string& config)
+{
+ return cmStrCat("CMakeFiles/impl-", config,
+ cmGlobalNinjaMultiGenerator::NINJA_FILE_EXTENSION);
}
-std::string cmGlobalNinjaMultiGenerator::GetNinjaFilename(
+std::string cmGlobalNinjaMultiGenerator::GetNinjaConfigFilename(
const std::string& config)
{
return cmStrCat("build-", config,
@@ -2398,7 +2488,8 @@ void cmGlobalNinjaMultiGenerator::AddRebuildManifestOutputs(
cmNinjaDeps& outputs) const
{
for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs()) {
- outputs.push_back(this->NinjaOutputPath(GetNinjaFilename(config)));
+ outputs.push_back(this->NinjaOutputPath(GetNinjaImplFilename(config)));
+ outputs.push_back(this->NinjaOutputPath(GetNinjaConfigFilename(config)));
}
if (this->Makefiles.front()->GetDefinition(
"CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE")) {
@@ -2416,20 +2507,21 @@ void cmGlobalNinjaMultiGenerator::GetQtAutoGenConfigs(
}
}
-bool cmGlobalNinjaMultiGenerator::WriteDefaultBuildFile()
+const char* cmGlobalNinjaMultiGenerator::GetDefaultBuildType() const
{
- auto const* defaultConfig = this->Makefiles.front()->GetDefinition(
+ return this->Makefiles.front()->GetDefinition(
"CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE");
- if (defaultConfig) {
- std::unique_ptr<cmGeneratedFileStream> defaultStream;
- if (!this->OpenFileStream(defaultStream, NINJA_BUILD_FILE)) {
- return false;
+}
+
+const char* cmGlobalNinjaMultiGenerator::GetDefaultBuildAlias() const
+{
+ if (this->EnableCrossConfigBuild()) {
+ auto const* alias = this->Makefiles.front()->GetDefinition(
+ "CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS");
+ if (alias) {
+ return alias;
}
- *defaultStream << "# This file is a convenience file generated by\n"
- << "# CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE.\n\n"
- << "include " << this->GetNinjaFilename(defaultConfig)
- << "\n";
}
- return true;
+ return this->GetDefaultBuildType();
}
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 3545f1e..b61999f 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -208,12 +208,23 @@ public:
}
const char* GetCleanTargetName() const override { return "clean"; }
+ virtual cmGeneratedFileStream* GetImplFileStream(
+ const std::string& /*config*/) const
+ {
+ return this->BuildFileStream.get();
+ }
+
virtual cmGeneratedFileStream* GetConfigFileStream(
const std::string& /*config*/) const
{
return this->BuildFileStream.get();
}
+ virtual cmGeneratedFileStream* GetDefaultFileStream() const
+ {
+ return this->BuildFileStream.get();
+ }
+
virtual cmGeneratedFileStream* GetCommonFileStream() const
{
return this->BuildFileStream.get();
@@ -397,6 +408,10 @@ public:
bool EnableCrossConfigBuild() const;
+ virtual const char* GetDefaultBuildType() const { return nullptr; }
+
+ virtual const char* GetDefaultBuildAlias() const { return nullptr; }
+
protected:
void Generate() override;
@@ -404,7 +419,6 @@ protected:
virtual bool OpenBuildFileStreams();
virtual void CloseBuildFileStreams();
- virtual bool WriteDefaultBuildFile() { return true; }
bool OpenFileStream(std::unique_ptr<cmGeneratedFileStream>& stream,
const std::string& name);
@@ -573,12 +587,23 @@ public:
std::string ExpandCFGIntDir(const std::string& str,
const std::string& config) const override;
+ cmGeneratedFileStream* GetImplFileStream(
+ const std::string& config) const override
+ {
+ return this->ImplFileStreams.at(config).get();
+ }
+
cmGeneratedFileStream* GetConfigFileStream(
const std::string& config) const override
{
return this->ConfigFileStreams.at(config).get();
}
+ cmGeneratedFileStream* GetDefaultFileStream() const override
+ {
+ return this->DefaultFileStream.get();
+ }
+
cmGeneratedFileStream* GetCommonFileStream() const override
{
return this->CommonFileStream.get();
@@ -587,13 +612,16 @@ public:
void AppendNinjaFileArgument(GeneratedMakeCommand& command,
const std::string& config) const override;
- static std::string GetNinjaFilename(const std::string& config);
+ static std::string GetNinjaImplFilename(const std::string& config);
+ static std::string GetNinjaConfigFilename(const std::string& config);
void AddRebuildManifestOutputs(cmNinjaDeps& outputs) const override;
void GetQtAutoGenConfigs(std::vector<std::string>& configs) const override;
- bool WriteDefaultBuildFile() override;
+ const char* GetDefaultBuildType() const override;
+
+ const char* GetDefaultBuildAlias() const override;
protected:
bool OpenBuildFileStreams() override;
@@ -601,8 +629,11 @@ protected:
private:
std::map<std::string, std::unique_ptr<cmGeneratedFileStream>>
+ ImplFileStreams;
+ std::map<std::string, std::unique_ptr<cmGeneratedFileStream>>
ConfigFileStreams;
std::unique_ptr<cmGeneratedFileStream> CommonFileStream;
+ std::unique_ptr<cmGeneratedFileStream> DefaultFileStream;
};
#endif // ! cmGlobalNinjaGenerator_h
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 6967097..be1dd0d 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -64,7 +64,7 @@ void cmLocalNinjaGenerator::Generate()
if (this->GetGlobalGenerator()->IsMultiConfig()) {
for (auto const& config : this->GetConfigNames()) {
- this->WriteProcessedMakefile(this->GetConfigFileStream(config));
+ this->WriteProcessedMakefile(this->GetImplFileStream(config));
}
}
this->WriteProcessedMakefile(this->GetCommonFileStream());
@@ -154,10 +154,10 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
// Private methods.
-cmGeneratedFileStream& cmLocalNinjaGenerator::GetConfigFileStream(
+cmGeneratedFileStream& cmLocalNinjaGenerator::GetImplFileStream(
const std::string& config) const
{
- return *this->GetGlobalNinjaGenerator()->GetConfigFileStream(config);
+ return *this->GetGlobalNinjaGenerator()->GetImplFileStream(config);
}
cmGeneratedFileStream& cmLocalNinjaGenerator::GetCommonFileStream() const
@@ -186,7 +186,7 @@ void cmLocalNinjaGenerator::WriteBuildFileTop()
if (this->GetGlobalGenerator()->IsMultiConfig()) {
for (auto const& config : this->GetConfigNames()) {
- auto& stream = this->GetConfigFileStream(config);
+ auto& stream = this->GetImplFileStream(config);
this->WriteProjectHeader(stream);
this->WriteNinjaRequiredVersion(stream);
this->WriteNinjaConfigurationVariable(stream, config);
@@ -560,7 +560,7 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
build.Outputs = std::move(ninjaOutputs);
build.ExplicitDeps = std::move(ninjaDeps);
build.OrderOnlyDeps = orderOnlyDeps;
- gg->WriteBuild(this->GetConfigFileStream(config), build);
+ gg->WriteBuild(this->GetImplFileStream(config), build);
} else {
std::string customStep = cmSystemTools::GetFilenameName(ninjaOutputs[0]);
// Hash full path to make unique.
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 0445879..ef160e7 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -86,7 +86,7 @@ protected:
bool forceFullPaths = false) override;
private:
- cmGeneratedFileStream& GetConfigFileStream(const std::string& config) const;
+ cmGeneratedFileStream& GetImplFileStream(const std::string& config) const;
cmGeneratedFileStream& GetCommonFileStream() const;
cmGeneratedFileStream& GetRulesFileStream() const;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index f853ac5..a871a92 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -811,9 +811,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
}
// Write comments.
- cmGlobalNinjaGenerator::WriteDivider(this->GetConfigFileStream(fileConfig));
+ cmGlobalNinjaGenerator::WriteDivider(this->GetImplFileStream(fileConfig));
const cmStateEnums::TargetType targetType = gt->GetType();
- this->GetConfigFileStream(fileConfig)
+ this->GetImplFileStream(fileConfig)
<< "# Link build statements for " << cmState::GetTargetTypeName(targetType)
<< " target " << this->GetTargetName() << "\n\n";
@@ -1183,7 +1183,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
// Write the build statement for this target.
bool usedResponseFile = false;
- globalGen->WriteBuild(this->GetConfigFileStream(fileConfig), linkBuild,
+ globalGen->WriteBuild(this->GetImplFileStream(fileConfig), linkBuild,
commandLineLengthLimit, &usedResponseFile);
this->WriteLinkRule(usedResponseFile, config);
@@ -1197,7 +1197,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
}
build.ExplicitDeps.push_back(targetOutputReal);
build.Variables = std::move(symlinkVars);
- globalGen->WriteBuild(this->GetConfigFileStream(fileConfig), build);
+ globalGen->WriteBuild(this->GetImplFileStream(fileConfig), build);
} else {
cmNinjaBuild build("CMAKE_SYMLINK_LIBRARY");
build.Comment = "Create library symlink " + targetOutput;
@@ -1223,7 +1223,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
build.ExplicitDeps.push_back(targetOutputReal);
build.Variables = std::move(symlinkVars);
- globalGen->WriteBuild(this->GetConfigFileStream(fileConfig), build);
+ globalGen->WriteBuild(this->GetImplFileStream(fileConfig), build);
}
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 5a8c144..455d809 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -68,10 +68,10 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
cmNinjaTargetGenerator::~cmNinjaTargetGenerator() = default;
-cmGeneratedFileStream& cmNinjaTargetGenerator::GetConfigFileStream(
+cmGeneratedFileStream& cmNinjaTargetGenerator::GetImplFileStream(
const std::string& config) const
{
- return *this->GetGlobalGenerator()->GetConfigFileStream(config);
+ return *this->GetGlobalGenerator()->GetImplFileStream(config);
}
cmGeneratedFileStream& cmNinjaTargetGenerator::GetCommonFileStream() const
@@ -815,8 +815,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
bool firstForConfig)
{
// Write comments.
- cmGlobalNinjaGenerator::WriteDivider(this->GetConfigFileStream(fileConfig));
- this->GetConfigFileStream(fileConfig)
+ cmGlobalNinjaGenerator::WriteDivider(this->GetImplFileStream(fileConfig));
+ this->GetImplFileStream(fileConfig)
<< "# Object build statements for "
<< cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType())
<< " target " << this->GetTargetName() << "\n\n";
@@ -901,8 +901,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
orderOnlyDeps.push_back(this->ConvertToNinjaPath(tgtDir));
}
- this->GetGlobalGenerator()->WriteBuild(
- this->GetConfigFileStream(fileConfig), build);
+ this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
+ build);
}
{
@@ -935,11 +935,11 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
this->GeneratorTarget, build.OrderOnlyDeps, config, fileConfig,
DependOnTargetArtifact);
- this->GetGlobalGenerator()->WriteBuild(
- this->GetConfigFileStream(fileConfig), build);
+ this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
+ build);
}
- this->GetConfigFileStream(fileConfig) << "\n";
+ this->GetImplFileStream(fileConfig) << "\n";
if (!this->Configs[config].SwiftOutputMap.empty()) {
std::string const mapFilePath =
@@ -1177,8 +1177,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
ppBuild.Variables);
- this->GetGlobalGenerator()->WriteBuild(
- this->GetConfigFileStream(fileConfig), ppBuild, commandLineLengthLimit);
+ this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
+ ppBuild, commandLineLengthLimit);
}
if (needDyndep) {
std::string const dyndep = this->GetDyndepFilePath(language, config);
@@ -1210,8 +1210,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
if (language == "Swift") {
this->EmitSwiftDependencyInfo(source, config);
} else {
- this->GetGlobalGenerator()->WriteBuild(
- this->GetConfigFileStream(fileConfig), objBuild, commandLineLengthLimit);
+ this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
+ objBuild, commandLineLengthLimit);
}
if (const char* objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) {
@@ -1221,8 +1221,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
std::transform(build.Outputs.begin(), build.Outputs.end(),
build.Outputs.begin(), MapToNinjaPath());
build.ExplicitDeps = objBuild.Outputs;
- this->GetGlobalGenerator()->WriteBuild(
- this->GetConfigFileStream(fileConfig), build);
+ this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
+ build);
}
}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 22dd7b8..bca12b1 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -47,7 +47,7 @@ public:
protected:
bool SetMsvcTargetPdbVariable(cmNinjaVars&, const std::string& config) const;
- cmGeneratedFileStream& GetConfigFileStream(const std::string& config) const;
+ cmGeneratedFileStream& GetImplFileStream(const std::string& config) const;
cmGeneratedFileStream& GetCommonFileStream() const;
cmGeneratedFileStream& GetRulesFileStream() const;
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 0cddb12..a42d65d 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -164,6 +164,6 @@ void cmNinjaUtilityTargetGenerator::Generate(const std::string& config)
cmNinjaBuild phonyAlias("phony");
gg->AppendTargetOutputs(genTarget, phonyAlias.Outputs, "");
phonyAlias.ExplicitDeps = phonyBuild.Outputs;
- gg->WriteBuild(this->GetConfigFileStream(config), phonyAlias);
+ gg->WriteBuild(this->GetImplFileStream(config), phonyAlias);
}
}