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/CPack/cpack.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/CPack/cpack.cxx')
-rw-r--r-- | Source/CPack/cpack.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 76e19dc..cc1ddf5 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -16,6 +16,7 @@ #include "cmCPackGenerator.h" #include "cmCPackGeneratorFactory.h" #include "cmCPackLog.h" +#include "cmConsoleBuf.h" #include "cmDocumentation.h" #include "cmDocumentationEntry.h" #include "cmDocumentationFormatter.h" @@ -27,10 +28,6 @@ #include "cmSystemTools.h" #include "cmake.h" -#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP) -# include "cmsys/ConsoleBuf.hxx" -#endif - namespace { const char* cmDocumentationName[][2] = { { nullptr, " cpack - Packaging driver provided by CMake." }, @@ -103,13 +100,11 @@ void cpackProgressCallback(const std::string& message, float /*unused*/) 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 args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); argc = args.argc(); |