[Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-636-gdfe2e25
Brad King
brad.king at kitware.com
Thu Oct 20 13:36:15 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via dfe2e256cdfdec77894e0fb7832279c996b3d81e (commit)
via ced77d2bbd07d195f563217bea1930e29472fd4d (commit)
from b4f95726130a6241e65be94083866176d8c431e1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dfe2e256cdfdec77894e0fb7832279c996b3d81e
commit dfe2e256cdfdec77894e0fb7832279c996b3d81e
Merge: b4f9572 ced77d2
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 20 13:36:14 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 20 13:36:14 2016 -0400
Merge topic 'ninja-encoding' into next
ced77d2b Ninja: Use ANSI encoding for Ninja build files on Windows
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ced77d2bbd07d195f563217bea1930e29472fd4d
commit ced77d2bbd07d195f563217bea1930e29472fd4d
Author: Dāvis Mosāns <davispuh at gmail.com>
AuthorDate: Wed Oct 19 23:51:51 2016 +0300
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 20 13:13:48 2016 -0400
Ninja: Use ANSI encoding for Ninja build files on Windows
Pass ANSI encoding to cmGeneratedFileStream for use with Ninja
generator.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index b90428d..22302fb 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -496,6 +496,18 @@ cmLocalGenerator* cmGlobalNinjaGenerator::CreateLocalGenerator(cmMakefile* mf)
return new cmLocalNinjaGenerator(this, mf);
}
+codecvt::Encoding cmGlobalNinjaGenerator::GetMakefileEncoding() const
+{
+#ifdef _WIN32
+ // Ninja on Windows does not support non-ANSI characters.
+ // https://github.com/ninja-build/ninja/issues/1195
+ return codecvt::ANSI;
+#else
+ // No encoding conversion needed on other platforms.
+ return codecvt::None;
+#endif
+}
+
void cmGlobalNinjaGenerator::GetDocumentation(cmDocumentationEntry& entry)
{
entry.Name = cmGlobalNinjaGenerator::GetActualName();
@@ -754,7 +766,8 @@ void cmGlobalNinjaGenerator::OpenBuildFileStream()
// Get a stream where to generate things.
if (!this->BuildFileStream) {
- this->BuildFileStream = new cmGeneratedFileStream(buildFilePath.c_str());
+ this->BuildFileStream = new cmGeneratedFileStream(
+ buildFilePath.c_str(), false, this->GetMakefileEncoding());
if (!this->BuildFileStream) {
// An error message is generated by the constructor if it cannot
// open the file.
@@ -791,7 +804,8 @@ void cmGlobalNinjaGenerator::OpenRulesFileStream()
// Get a stream where to generate things.
if (!this->RulesFileStream) {
- this->RulesFileStream = new cmGeneratedFileStream(rulesFilePath.c_str());
+ this->RulesFileStream = new cmGeneratedFileStream(
+ rulesFilePath.c_str(), false, this->GetMakefileEncoding());
if (!this->RulesFileStream) {
// An error message is generated by the constructor if it cannot
// open the file.
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index d4a14e2..3d13e0b 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -186,6 +186,9 @@ public:
static std::string GetActualName() { return "Ninja"; }
+ /** Get encoding used by generator for ninja files */
+ codecvt::Encoding GetMakefileEncoding() const CM_OVERRIDE;
+
static void GetDocumentation(cmDocumentationEntry& entry);
void EnableLanguage(std::vector<std::string> const& languages,
-----------------------------------------------------------------------
Summary of changes:
Source/cmGlobalNinjaGenerator.cxx | 18 ++++++++++++++++--
Source/cmGlobalNinjaGenerator.h | 3 +++
2 files changed, 19 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list