summaryrefslogtreecommitdiffstats
path: root/Source/cmExportLibraryDependenciesCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmExportLibraryDependenciesCommand.cxx')
-rw-r--r--Source/cmExportLibraryDependenciesCommand.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index b4b2962..0a0646c 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -50,8 +50,9 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
// Use copy-if-different if not appending.
std::unique_ptr<cmsys::ofstream> foutPtr;
if (this->Append) {
+ const auto openmodeApp = std::ios::app;
foutPtr =
- cm::make_unique<cmsys::ofstream>(this->Filename.c_str(), std::ios::app);
+ cm::make_unique<cmsys::ofstream>(this->Filename.c_str(), openmodeApp);
} else {
std::unique_ptr<cmGeneratedFileStream> ap(
new cmGeneratedFileStream(this->Filename, true));
@@ -61,7 +62,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
std::ostream& fout = *foutPtr;
if (!fout) {
- cmSystemTools::Error("Error Writing ", this->Filename.c_str());
+ cmSystemTools::Error("Error Writing " + this->Filename);
cmSystemTools::ReportLastSystemError("");
return;
}