summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cpack.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-14 14:57:46 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-14 16:08:06 (GMT)
commit90b39a52090e6ba52424b441d5827b2b6e11ff56 (patch)
tree9c4e327b43eaa0a34b3f41e210c22e103f08611d /Source/CPack/cpack.cxx
parentf1fdd15863150fe42e99a95362a4387333502262 (diff)
downloadCMake-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.cxx15
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();