summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-18 13:39:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-06-18 13:39:24 (GMT)
commitd64d2d12c39f54f953fa946cf01fedf33ee2db70 (patch)
tree0c1bb1fae67f73ad2052952e23afa431d8f41ea8 /Source
parent333e1973cebaff2bf3158d237c24763b91e1ad65 (diff)
parent9ba99a1203efea8e5c3977514b22f6204507f17b (diff)
downloadCMake-d64d2d12c39f54f953fa946cf01fedf33ee2db70.zip
CMake-d64d2d12c39f54f953fa946cf01fedf33ee2db70.tar.gz
CMake-d64d2d12c39f54f953fa946cf01fedf33ee2db70.tar.bz2
Merge topic 'vs-utf-8' into release-3.21
9ba99a1203 VS: Add support for Utf8Enconding when using VS 16.10+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6238
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h2
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx15
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.h2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx4
4 files changed, 22 insertions, 1 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 646dbe2..b7ae1ee 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -138,6 +138,8 @@ public:
virtual bool IsStdOutEncodingSupported() const { return false; }
+ virtual bool IsUtf8EncodingSupported() const { return false; }
+
static std::string GetInstalledNsightTegraVersion();
/** Return the first two components of CMAKE_SYSTEM_VERSION. */
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 384aa66..c8213c5 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -417,6 +417,21 @@ bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer16_7_P2));
}
+bool cmGlobalVisualStudioVersionedGenerator::IsUtf8EncodingSupported() const
+{
+ // Supported from Visual Studio 16.10 Preview 2.
+ if (this->Version > cmGlobalVisualStudioGenerator::VSVersion::VS16) {
+ return true;
+ }
+ if (this->Version < cmGlobalVisualStudioGenerator::VSVersion::VS16) {
+ return false;
+ }
+ static std::string const vsVer16_10_P2 = "16.10.31213.239";
+ cm::optional<std::string> vsVer = this->GetVSInstanceVersion();
+ return (vsVer &&
+ cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer16_10_P2));
+}
+
const char*
cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision()
const
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h
index db4a0ba..e6c19e4 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.h
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.h
@@ -35,6 +35,8 @@ public:
bool IsStdOutEncodingSupported() const override;
+ bool IsUtf8EncodingSupported() const override;
+
const char* GetAndroidApplicationTypeRevision() const override;
protected:
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index b79c6fd..11a8b1f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -5115,7 +5115,9 @@ std::string cmVisualStudio10TargetGenerator::GetCMakeFilePath(
void cmVisualStudio10TargetGenerator::WriteStdOutEncodingUtf8(Elem& e1)
{
- if (this->GlobalGenerator->IsStdOutEncodingSupported()) {
+ if (this->GlobalGenerator->IsUtf8EncodingSupported()) {
+ e1.Element("UseUtf8Encoding", "Always");
+ } else if (this->GlobalGenerator->IsStdOutEncodingSupported()) {
e1.Element("StdOutEncoding", "UTF-8");
}
}