diff options
author | Brad King <brad.king@kitware.com> | 2021-04-21 14:46:12 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-04-21 10:46:18 -0400 |
commit | 02fbe4083c95b46dd5b066639f40ce33f75f2d46 (patch) | |
tree | d8d91a799a53fa23a83fb65d848883bbd1d056f3 | |
parent | 6f7ab69026171bf603b9ba5068c54c6df4fe21b1 (diff) | |
parent | 835896e985a0333e56623d16761dfa2b37d0a7e2 (diff) | |
download | cmake-02fbe4083c95b46dd5b066639f40ce33f75f2d46.tar.gz |
Merge topic 'cmake-timestamp-error'
835896e985 cmake: Improve error message when failing to update generation timestamp
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6021
-rw-r--r-- | Source/cmake.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index af3a504fd9..d24e268d45 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -3074,12 +3074,16 @@ static bool cmakeCheckStampFile(const std::string& stampName) cmsys::ofstream stamp(stampTemp.c_str()); stamp << "# CMake generation timestamp file for this directory.\n"; } - if (cmSystemTools::RenameFile(stampTemp, stampName)) { + std::string err; + if (cmSystemTools::RenameFile(stampTemp, stampName, + cmSystemTools::Replace::Yes, &err) == + cmSystemTools::RenameResult::Success) { // CMake does not need to re-run because the stamp file is up-to-date. return true; } cmSystemTools::RemoveFile(stampTemp); - cmSystemTools::Error("Cannot restore timestamp " + stampName); + cmSystemTools::Error( + cmStrCat("Cannot restore timestamp \"", stampName, "\": ", err)); return false; } |