diff options
author | Brad King <brad.king@kitware.com> | 2020-10-14 14:57:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-10-14 16:08:06 (GMT) |
commit | 90b39a52090e6ba52424b441d5827b2b6e11ff56 (patch) | |
tree | 9c4e327b43eaa0a34b3f41e210c22e103f08611d /Source/ctest.cxx | |
parent | f1fdd15863150fe42e99a95362a4387333502262 (diff) | |
download | CMake-90b39a52090e6ba52424b441d5827b2b6e11ff56.zip CMake-90b39a52090e6ba52424b441d5827b2b6e11ff56.tar.gz CMake-90b39a52090e6ba52424b441d5827b2b6e11ff56.tar.bz2 |
cmConsoleBuf: Factor out cout/cerr console buffer management
Diffstat (limited to 'Source/ctest.cxx')
-rw-r--r-- | Source/ctest.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/ctest.cxx b/Source/ctest.cxx index f06981a..d0bc061 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -9,14 +9,12 @@ #include "cmsys/Encoding.hxx" #include "cmCTest.h" +#include "cmConsoleBuf.h" #include "cmDocumentation.h" #include "cmSystemTools.h" #include "CTest/cmCTestLaunch.h" #include "CTest/cmCTestScriptHandler.h" -#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP) -# include "cmsys/ConsoleBuf.hxx" -#endif static const char* cmDocumentationName[][2] = { { nullptr, " ctest - Testing driver provided by CMake." }, @@ -155,13 +153,11 @@ static const char* cmDocumentationOptions[][2] = { int main(int argc, char const* const* argv) { cmSystemTools::EnsureStdPipes(); -#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP) + // Replace streambuf so we can output Unicode to console - cmsys::ConsoleBuf::Manager consoleOut(std::cout); - consoleOut.SetUTF8Pipes(); - cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); - consoleErr.SetUTF8Pipes(); -#endif + cmConsoleBuf consoleBuf; + consoleBuf.SetUTF8Pipes(); + cmsys::Encoding::CommandLineArguments encoding_args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); argc = encoding_args.argc(); |