summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.h
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-07-24 20:08:04 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-08-29 14:51:30 (GMT)
commit49a37d5a97ccd6e59b9e205a96b9dec251708f76 (patch)
tree2413906111f0692bb31ae5e3605c8346bfd35dfd /Source/cmSystemTools.h
parentbc702aa97eb892208c2ad010129d52cae62fb73a (diff)
downloadCMake-49a37d5a97ccd6e59b9e205a96b9dec251708f76.zip
CMake-49a37d5a97ccd6e59b9e205a96b9dec251708f76.tar.gz
CMake-49a37d5a97ccd6e59b9e205a96b9dec251708f76.tar.bz2
cmCTestScriptHandler: Replace cmsysProcess with cmUVProcessChain
And update cmSystemTools::WaitForLine() to use cmUVProcessChain.
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r--Source/cmSystemTools.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 9563fd6..c3b8525 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -18,6 +18,8 @@
#include <cm/optional>
#include <cm/string_view>
+#include <cm3p/uv.h>
+
#include "cmsys/Process.h"
#include "cmsys/Status.hxx" // IWYU pragma: export
#include "cmsys/SystemTools.hxx" // IWYU pragma: export
@@ -339,10 +341,20 @@ public:
*/
static void ReportLastSystemError(const char* m);
- /** a general output handler for cmsysProcess */
- static int WaitForLine(cmsysProcess* process, std::string& line,
- cmDuration timeout, std::vector<char>& out,
- std::vector<char>& err);
+ enum class WaitForLineResult
+ {
+ None,
+ STDOUT,
+ STDERR,
+ Timeout,
+ };
+
+ /** a general output handler for libuv */
+ static WaitForLineResult WaitForLine(uv_loop_t* loop, uv_stream_t* outPipe,
+ uv_stream_t* errPipe, std::string& line,
+ cmDuration timeout,
+ std::vector<char>& out,
+ std::vector<char>& err);
static void SetForceUnixPaths(bool v) { s_ForceUnixPaths = v; }
static bool GetForceUnixPaths() { return s_ForceUnixPaths; }