summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-10-09 13:51:01 -0400
committerKyle Edwards <kyle.edwards@kitware.com>2020-10-09 13:51:01 -0400
commitf4215ee57d53decea1623f60da2a598d035bf74a (patch)
treeb272a7dd1455245cedc4e5ca692b6cb575a6f233
parent18372afcd433cab570cbfa1223d05c604b1480b9 (diff)
downloadcmake-f4215ee57d53decea1623f60da2a598d035bf74a.tar.gz
Ninja Multi-Config: Fix segfault when installing an export
Fixes: #21290
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 6b9a0f399c..985f43041f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -2532,14 +2532,14 @@ bool cmGlobalNinjaMultiGenerator::OpenBuildFileStreams()
return false;
}
- if (!this->DefaultFileConfig.empty()) {
- if (!this->OpenFileStream(this->DefaultFileStream, NINJA_BUILD_FILE)) {
- return false;
- }
- *this->DefaultFileStream
- << "# Build using rules for '" << this->DefaultFileConfig << "'.\n\n"
- << "include " << GetNinjaImplFilename(this->DefaultFileConfig) << "\n\n";
+ if (!this->OpenFileStream(this->DefaultFileStream, NINJA_BUILD_FILE)) {
+ return false;
}
+ *this->DefaultFileStream << "# Build using rules for '"
+ << this->DefaultFileConfig << "'.\n\n"
+ << "include "
+ << GetNinjaImplFilename(this->DefaultFileConfig)
+ << "\n\n";
// Write a comment about this file.
*this->CommonFileStream