summaryrefslogtreecommitdiffstats
path: root/Source/cmConsoleBuf.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/cmConsoleBuf.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/cmConsoleBuf.cxx')
-rw-r--r--Source/cmConsoleBuf.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmConsoleBuf.cxx b/Source/cmConsoleBuf.cxx
new file mode 100644
index 0000000..70be481
--- /dev/null
+++ b/Source/cmConsoleBuf.cxx
@@ -0,0 +1,23 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmConsoleBuf.h"
+
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
+cmConsoleBuf::cmConsoleBuf()
+ : m_ConsoleOut(std::cout)
+ , m_ConsoleErr(std::cerr, true)
+{
+}
+#else
+cmConsoleBuf::cmConsoleBuf() = default;
+#endif
+
+cmConsoleBuf::~cmConsoleBuf() = default;
+
+void cmConsoleBuf::SetUTF8Pipes()
+{
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
+ m_ConsoleOut.SetUTF8Pipes();
+ m_ConsoleErr.SetUTF8Pipes();
+#endif
+}