summaryrefslogtreecommitdiffstats
path: root/Source/cmExportLibraryDependenciesCommand.cxx
diff options
context:
space:
mode:
authorZsolt Parragi <zsolt.parragi@cancellar.hu>2018-11-06 19:40:18 (GMT)
committerZsolt Parragi <zsolt.parragi@cancellar.hu>2019-02-11 14:04:28 (GMT)
commit006768903cb6586098218822129d622737848299 (patch)
tree0d8ad29e88929a7ca94620e7d52add62221f1225 /Source/cmExportLibraryDependenciesCommand.cxx
parentd625dfcdf9ad36802d0615cd929dd5c407a46524 (diff)
downloadCMake-006768903cb6586098218822129d622737848299.zip
CMake-006768903cb6586098218822129d622737848299.tar.gz
CMake-006768903cb6586098218822129d622737848299.tar.bz2
Work around clang-cl breakage on make_unique/std::forward
Clang on Windows with the MSVC ABI produces link errors of the form `unresolved std::_Iosb<int>::{app,_Openmode} in ...`. Use a temporary variable to forward as lvalue rather than rvalue to work around the problem.
Diffstat (limited to 'Source/cmExportLibraryDependenciesCommand.cxx')
-rw-r--r--Source/cmExportLibraryDependenciesCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index b4b2962..e542e50 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));