diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-09 13:51:01 -0400 |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-09 13:51:01 -0400 |
commit | f4215ee57d53decea1623f60da2a598d035bf74a (patch) | |
tree | b272a7dd1455245cedc4e5ca692b6cb575a6f233 | |
parent | 18372afcd433cab570cbfa1223d05c604b1480b9 (diff) | |
download | cmake-f4215ee57d53decea1623f60da2a598d035bf74a.tar.gz |
Ninja Multi-Config: Fix segfault when installing an export
Fixes: #21290
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 14 |
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 |