1
0
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:
Jonathan Marler
2017-09-19 09:07:27 -06:00
committed by Brad King
parent 95df03a1d4
commit c2d6835c17

View File

@@ -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) {