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/cmakemain.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/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index d662a9a..eb44329 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -15,6 +15,7 @@ #include <cm3p/uv.h> +#include "cmConsoleBuf.h" #include "cmDocumentationEntry.h" // IWYU pragma: keep #include "cmGlobalGenerator.h" #include "cmMakefile.h" @@ -32,9 +33,6 @@ #endif #include "cmsys/Encoding.hxx" -#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP) -# include "cmsys/ConsoleBuf.hxx" -#endif namespace { #ifndef CMAKE_BOOTSTRAP @@ -687,13 +685,11 @@ int do_open(int ac, char const* const* av) int main(int ac, char const* const* av) { 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 args = cmsys::Encoding::CommandLineArguments::Main(ac, av); ac = args.argc(); |