diff options
author | Brad King <brad.king@kitware.com> | 2020-02-04 16:37:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-02-04 16:46:18 (GMT) |
commit | 9135954e2fe607c08e065601c52958652e11b684 (patch) | |
tree | 6afdcac3b09aa557ca76b84667f86d6982420a0e /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 21e60da5bb0715e09f2feba5930ea2c8bc8180af (diff) | |
download | CMake-9135954e2fe607c08e065601c52958652e11b684.zip CMake-9135954e2fe607c08e065601c52958652e11b684.tar.gz CMake-9135954e2fe607c08e065601c52958652e11b684.tar.bz2 |
VS: Do not use native unity builds on VS 2017 versions less than 15.8
VS 2017 version 15.8 introduced support for unity builds implemented
in part by the `$(VCTargetsPath)/Microsoft.Cpp.Unity.targets` file.
Do not enable unity builds on VS 15 versions that do not have that file.
Fixes: #20284
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 53fc93c..7e8e610 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2085,9 +2085,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) const bool haveUnityBuild = this->GeneratorTarget->GetPropertyAsBool("UNITY_BUILD"); - if (haveUnityBuild && - this->GlobalGenerator->GetVersion() >= - cmGlobalVisualStudioGenerator::VS15) { + if (haveUnityBuild && this->GlobalGenerator->GetSupportsUnityBuilds()) { Elem e1(e0, "PropertyGroup"); e1.Element("EnableUnitySupport", "true"); } @@ -2193,9 +2191,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) this->WriteSource(e2, si.Source); bool useNativeUnityBuild = false; - if (haveUnityBuild && - this->GlobalGenerator->GetVersion() >= - cmGlobalVisualStudioGenerator::VS15) { + if (haveUnityBuild && this->GlobalGenerator->GetSupportsUnityBuilds()) { // Magic value taken from cmGlobalVisualStudioVersionedGenerator.cxx static const std::string vs15 = "141"; std::string toolset = @@ -2222,7 +2218,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) si.Source->GetProperty("UNITY_SOURCE_FILE")); e2.Attribute("UnityFilesDirectory", unityDir); } else { - // Visual Studio versions prior to 2017 do not know about unity + // Visual Studio versions prior to 2017 15.8 do not know about unity // builds, thus we exclude the files alredy part of unity sources. if (!si.Source->GetPropertyAsBool("SKIP_UNITY_BUILD_INCLUSION")) { exclude_configs = si.Configs; |