mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-21 06:10:16 +08:00
cmSystemTools: Teach RunSingleCommand another way to report exceptions
If the caller captures stdout but not stderr then report exceptions through stdout instead of dropping them.
This commit is contained in:

committed by
Brad King

parent
95df03a1d4
commit
c2d6835c17
@@ -803,6 +803,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
|
||||
}
|
||||
if (captureStdErr) {
|
||||
captureStdErr->append(exception_str, strlen(exception_str));
|
||||
} else if (captureStdOut) {
|
||||
captureStdOut->append(exception_str, strlen(exception_str));
|
||||
}
|
||||
result = false;
|
||||
} else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Error) {
|
||||
@@ -812,6 +814,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
|
||||
}
|
||||
if (captureStdErr) {
|
||||
captureStdErr->append(error_str, strlen(error_str));
|
||||
} else if (captureStdOut) {
|
||||
captureStdOut->append(error_str, strlen(error_str));
|
||||
}
|
||||
result = false;
|
||||
} else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Expired) {
|
||||
|
Reference in New Issue
Block a user