summaryrefslogtreecommitdiff
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-03-10 16:24:31 +0000
committerKitware Robot <kwrobot@kitware.com>2021-03-10 11:24:39 -0500
commitf23aa1c1202b55121a2c90aaab97aeee28a8eec6 (patch)
tree019c081e29868c86384333722cbb730fafaecb29 /Source/cmLocalNinjaGenerator.cxx
parentfb40808b76a72a1783a2d179fde4b60da8a4a3d5 (diff)
parent9af6e2e7b2940d5ba4d138f0df5950a675ec41c0 (diff)
downloadcmake-f23aa1c1202b55121a2c90aaab97aeee28a8eec6.tar.gz
Merge topic 'ninja-utf8'
9af6e2e7b2 Ninja: Use new wincodepage tool to determine encoding Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5860
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 64ff579dc2..981c9cfff3 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -97,9 +97,12 @@ void cmLocalNinjaGenerator::Generate()
// contains any non-ASCII characters and dependency checking will fail.
// As a workaround, leave the msvc_deps_prefix UTF-8 encoded even though
// the rest of the file is ANSI encoded.
- if (GetConsoleOutputCP() == CP_UTF8 && GetACP() != CP_UTF8) {
+ if (GetConsoleOutputCP() == CP_UTF8 && GetACP() != CP_UTF8 &&
+ this->GetGlobalGenerator()->GetMakefileEncoding() != codecvt::None) {
this->GetRulesFileStream().WriteRaw(showIncludesPrefix);
} else {
+ // Ninja 1.11 and above uses the UTF-8 code page if it's supported, so
+ // in that case we can write it normally without using raw bytes.
this->GetRulesFileStream() << showIncludesPrefix;
}
#else