mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 22:58:37 -05:00
Merge topic 'cmFileCopier-error-loss'
a820877d03errors: avoid constructing a stream before getting the last error5cf7018af6cmFileCopier: remember error statuses and get their strings0639a32d3acmFileTimes: return status codes from APIs Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9023
This commit is contained in:
@@ -629,13 +629,11 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
|
||||
// now create a CMakeLists.txt file in that directory
|
||||
FILE* fout = cmsys::SystemTools::Fopen(outFileName, "w");
|
||||
if (!fout) {
|
||||
std::ostringstream e;
|
||||
/* clang-format off */
|
||||
e << "Failed to open\n"
|
||||
" " << outFileName << "\n"
|
||||
<< cmSystemTools::GetLastSystemError();
|
||||
/* clang-format on */
|
||||
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
|
||||
this->Makefile->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
cmStrCat("Failed to open\n"
|
||||
" ",
|
||||
outFileName, '\n', cmSystemTools::GetLastSystemError()));
|
||||
return cm::nullopt;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user