summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-10 15:00:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-08-10 15:01:11 (GMT)
commiteba2b13a835000a614f21a1205a598462a4f8843 (patch)
treec27706d515555ab3e4074902ec8aad71f461249d
parent0077c8c2637043b93f67ee310727542c081dc138 (diff)
parent7e359823c9cd5bf162e3e62561328607d4449a59 (diff)
downloadCMake-eba2b13a835000a614f21a1205a598462a4f8843.zip
CMake-eba2b13a835000a614f21a1205a598462a4f8843.tar.gz
CMake-eba2b13a835000a614f21a1205a598462a4f8843.tar.bz2
Merge topic 'msvc-link-non-english'
7e359823c9 MSVC: Preserve linker output encoding b7e7718a38 MSVC: Fix manifest resource encoding Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2261
-rw-r--r--Source/cmcmd.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 0a75e77..2027722 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -24,6 +24,7 @@
#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32)
# include "bindexplib.h"
+# include "cmsys/ConsoleBuf.hxx"
#endif
#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32) && !defined(__CYGWIN__)
@@ -1545,6 +1546,15 @@ private:
// still works.
int cmcmd::VisualStudioLink(std::vector<std::string> const& args, int type)
{
+#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+ // Replace streambuf so we output in the system codepage. CMake is set up
+ // to output in Unicode (see SetUTF8Pipes) but the Visual Studio linker
+ // outputs using the system codepage so we need to change behavior when
+ // we run the link command.
+ cmsys::ConsoleBuf::Manager consoleOut(std::cout);
+ cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true);
+#endif
+
if (args.size() < 2) {
return -1;
}
@@ -1775,6 +1785,8 @@ int cmVSLink::LinkIncremental()
if (!fout) {
return -1;
}
+ // Insert a pragma statement to specify utf-8 encoding.
+ fout << "#pragma code_page(65001)\n";
fout << this->Type
<< " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ "
"24 /* RT_MANIFEST */ \""