summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioVersionedGenerator.cxx
diff options
context:
space:
mode:
authorJustin Goshi <jgoshi@microsoft.com>2020-06-02 19:46:07 (GMT)
committerBrad King <brad.king@kitware.com>2020-06-03 13:00:41 (GMT)
commite219527a72e0f52308805b4c16f8f51d7678cca7 (patch)
treeab5b800cd6d5ebffa22d00418ed98641d40984d9 /Source/cmGlobalVisualStudioVersionedGenerator.cxx
parent8a7ad923a89030e63e60fb333169abd258732615 (diff)
downloadCMake-e219527a72e0f52308805b4c16f8f51d7678cca7.zip
CMake-e219527a72e0f52308805b4c16f8f51d7678cca7.tar.gz
CMake-e219527a72e0f52308805b4c16f8f51d7678cca7.tar.bz2
VS: Use StdOutEncoding for VS 16.7 Preview 3 and above
VS 16.6 added a `StdOutEncoding` setting for custom commands to tell MSBuild that the output is encoded as UTF-8. In commit bc877a7e94 (Add support to indicate UTF-8 custom command pipe output encoding, 2020-04-08) CMake learned to add the setting in anticipation of the VS 16.6 release. However, when 16.6 was released it had a bug in the implementation of custom tasks with StdOutEncoding enabled that was exposed by our test suite. In commit 5058fb5401 (VS: Drop StdOutEncoding with VS 16.6 pending investigation, 2020-05-29) we disabled the setting pending investigation. The problem is fixed in VS 16.7 Preview 3, so restore use of the setting when a VS instance of at least that version is detected. Fixes: #20769
Diffstat (limited to 'Source/cmGlobalVisualStudioVersionedGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index d44433b..605dc8b 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -393,6 +393,21 @@ bool cmGlobalVisualStudioVersionedGenerator::IsDefaultToolset(
return false;
}
+bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
+{
+ // Supported from Visual Studio 16.7 Preview 3.
+ if (this->Version > cmGlobalVisualStudioGenerator::VSVersion::VS16) {
+ return true;
+ }
+ if (this->Version < cmGlobalVisualStudioGenerator::VSVersion::VS16) {
+ return false;
+ }
+ unsigned long long const vsInstanceVersion16_7_P2 = 4503631666610212;
+ unsigned long long vsInstanceVersion;
+ return (this->GetVSInstanceVersion(vsInstanceVersion) &&
+ vsInstanceVersion > vsInstanceVersion16_7_P2);
+}
+
std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
{
const char* version = this->GetPlatformToolsetVersion();