diff options
author | Gustavo Varo <gustavo.varo@gmail.com> | 2021-06-16 22:05:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-17 17:44:22 (GMT) |
commit | 9ba99a1203efea8e5c3977514b22f6204507f17b (patch) | |
tree | 90f59ebe4cc4cda70077096ab9959ffb1edc1378 /Source/cmGlobalVisualStudioVersionedGenerator.cxx | |
parent | b0f830ced6552b055bc73de470a4631aa3a14430 (diff) | |
download | CMake-9ba99a1203efea8e5c3977514b22f6204507f17b.zip CMake-9ba99a1203efea8e5c3977514b22f6204507f17b.tar.gz CMake-9ba99a1203efea8e5c3977514b22f6204507f17b.tar.bz2 |
VS: Add support for Utf8Enconding when using VS 16.10+
On VS 16.10 Preview 2 or above, generate `UseUtf8Encoding`
instead of `StdOutEncoding=UTF-8` in `.vcxproj` files.
Fixes: #22032
Diffstat (limited to 'Source/cmGlobalVisualStudioVersionedGenerator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
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 |