diff options
author | Brad King <brad.king@kitware.com> | 2019-01-25 12:58:15 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-25 12:59:11 (GMT) |
commit | 9f84cbd8c323a5a59b666a8bc8199e52a181bb35 (patch) | |
tree | 238b6023b3df2c29e2160c373df263669e954fd8 /Source/cmSystemTools.cxx | |
parent | 5a6e683a32c8ba9f7610e4ca0c6c3d9e7888d934 (diff) | |
parent | 99337d345ba9d3379135c90854be23403fa8e274 (diff) | |
download | CMake-9f84cbd8c323a5a59b666a8bc8199e52a181bb35.zip CMake-9f84cbd8c323a5a59b666a8bc8199e52a181bb35.tar.gz CMake-9f84cbd8c323a5a59b666a8bc8199e52a181bb35.tar.bz2 |
Merge topic 'error-overloads'
99337d345b cmSystemTools::Error(): new overload accepting std::string
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2845
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 9abc5f3..2d98a7d 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -270,6 +270,13 @@ void cmSystemTools::Error(const char* m1, const char* m2, const char* m3, cmSystemTools::Message(message.c_str(), "Error"); } +void cmSystemTools::Error(const std::string& m) +{ + std::string message = "CMake Error: " + m; + cmSystemTools::s_ErrorOccured = true; + cmSystemTools::Message(message.c_str(), "Error"); +} + void cmSystemTools::SetInterruptCallback(InterruptCallback f, void* clientData) { s_InterruptCallback = f; @@ -338,7 +345,7 @@ void cmSystemTools::ReportLastSystemError(const char* msg) std::string m = msg; m += ": System Error: "; m += Superclass::GetLastSystemError(); - cmSystemTools::Error(m.c_str()); + cmSystemTools::Error(m); } bool cmSystemTools::IsInternallyOn(const char* val) @@ -549,7 +556,7 @@ std::vector<std::string> cmSystemTools::HandleResponseFile( error += cmSystemTools::GetLastSystemError(); error += "):\n "; error += arg.substr(1); - cmSystemTools::Error(error.c_str()); + cmSystemTools::Error(error); } else { std::string line; cmSystemTools::GetLineFromStream(responseFile, line); @@ -1651,7 +1658,7 @@ bool cmSystemTools::CreateTar(const char* outFileName, e += outFileName; e += "\": "; e += cmSystemTools::GetLastSystemError(); - cmSystemTools::Error(e.c_str()); + cmSystemTools::Error(e); return false; } cmArchiveWrite::Compress compress = cmArchiveWrite::CompressNone; @@ -1684,7 +1691,7 @@ bool cmSystemTools::CreateTar(const char* outFileName, } } if (!a) { - cmSystemTools::Error(a.GetError().c_str()); + cmSystemTools::Error(a.GetError()); return false; } return true; @@ -3120,7 +3127,7 @@ bool cmSystemTools::CreateSymlink(const std::string& origName, if (errorMessage) { *errorMessage = std::move(e); } else { - cmSystemTools::Error(e.c_str()); + cmSystemTools::Error(e); } return false; } @@ -3141,7 +3148,7 @@ bool cmSystemTools::CreateLink(const std::string& origName, if (errorMessage) { *errorMessage = std::move(e); } else { - cmSystemTools::Error(e.c_str()); + cmSystemTools::Error(e); } return false; } |