diff options
Diffstat (limited to 'Source/CPack/cpack.cxx')
-rw-r--r-- | Source/CPack/cpack.cxx | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 6c80753..85c13ad 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -1,12 +1,22 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ +#include <cstddef> +#include <iostream> +#include <map> +#include <memory> +#include <sstream> +#include <string> +#include <utility> +#include <vector> + #include "cmsys/CommandLineArguments.hxx" #include "cmsys/Encoding.hxx" #include "cmCPackGenerator.h" #include "cmCPackGeneratorFactory.h" #include "cmCPackLog.h" +#include "cmConsoleBuf.h" #include "cmDocumentation.h" #include "cmDocumentationEntry.h" #include "cmDocumentationFormatter.h" @@ -19,19 +29,6 @@ #include "cmSystemTools.h" #include "cmake.h" -#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP) -# include "cmsys/ConsoleBuf.hxx" -#endif - -#include <cstddef> -#include <iostream> -#include <map> -#include <memory> -#include <sstream> -#include <string> -#include <utility> -#include <vector> - namespace { const char* cmDocumentationName[][2] = { { nullptr, " cpack - Packaging driver provided by CMake." }, @@ -104,13 +101,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(); |