diff options
author | Brad King <brad.king@kitware.com> | 2014-12-08 14:07:12 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-12-08 14:07:12 (GMT) |
commit | 79d1e1347a63aef89441b43ad61303109062a55c (patch) | |
tree | 1524aa1967577605c9842227a1e61438b171b5e2 /Source | |
parent | 413ce0289599741b06fe14f7f8552c83277fa5bf (diff) | |
parent | 29b0c8c3606f07f3baee245138552c3c0256ded6 (diff) | |
download | CMake-79d1e1347a63aef89441b43ad61303109062a55c.zip CMake-79d1e1347a63aef89441b43ad61303109062a55c.tar.gz CMake-79d1e1347a63aef89441b43ad61303109062a55c.tar.bz2 |
Merge topic 'ctest-binary-pipe'
29b0c8c3 ctest --launch: write to cout and cerr in binary
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index b65d23b..77c5d57 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -21,6 +21,12 @@ #include <cmsys/RegularExpression.hxx> #include <cmsys/FStream.hxx> +#ifdef _WIN32 +#include <io.h> // for _setmode +#include <fcntl.h> // for _O_BINARY +#include <stdio.h> // for std{out,err} and fileno +#endif + //---------------------------------------------------------------------------- cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv) { @@ -259,6 +265,13 @@ void cmCTestLaunch::RunChild() std::ios::out | std::ios::binary); } +#ifdef _WIN32 + // Do this so that newline transformation is not done when writing to cout + // and cerr below. + _setmode(fileno(stdout), _O_BINARY); + _setmode(fileno(stderr), _O_BINARY); +#endif + // Run the real command. cmsysProcess_Execute(cp); |