summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio10Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-04 16:37:22 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-04 16:46:18 (GMT)
commit9135954e2fe607c08e065601c52958652e11b684 (patch)
tree6afdcac3b09aa557ca76b84667f86d6982420a0e /Source/cmGlobalVisualStudio10Generator.cxx
parent21e60da5bb0715e09f2feba5930ea2c8bc8180af (diff)
downloadCMake-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/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 09a49e1..f6472ab 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -230,6 +230,12 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
}
}
+ this->SupportsUnityBuilds =
+ this->Version >= cmGlobalVisualStudioGenerator::VS16 ||
+ (this->Version == cmGlobalVisualStudioGenerator::VS15 &&
+ cmSystemTools::PathExists(this->VCTargetsPath +
+ "/Microsoft.Cpp.Unity.targets"));
+
if (this->GeneratorToolsetCuda.empty()) {
// Find the highest available version of the CUDA tools.
std::vector<std::string> cudaTools;