summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-07-29 15:44:55 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2019-08-29 14:45:42 (GMT)
commit8dfeb5d278625c55be1cc82399d29c0305ee4438 (patch)
tree0367c00df079b5a9c1f2370f49cc525e7f532b14 /Source/cmLocalVisualStudio7Generator.cxx
parent7114c141e27532df709fcae1266bb4ce9b6e850c (diff)
downloadCMake-8dfeb5d278625c55be1cc82399d29c0305ee4438.zip
CMake-8dfeb5d278625c55be1cc82399d29c0305ee4438.tar.gz
CMake-8dfeb5d278625c55be1cc82399d29c0305ee4438.tar.bz2
Unity build: Add support for Visual Studio generator
It works as expected in Visual Studio. Visual Studio 2017 will (partially) benefit from the build in support for unity builds. The custom unity sources are used, because the build in support doesn't allow batching of certain number of files. It can do only batching by directory.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 795cee4..e9335c6 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1320,6 +1320,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
const std::string& libName,
cmGeneratorTarget* target)
{
+ this->AddUnityBuild(target, "");
this->AddPchDependencies(target, "");
std::vector<std::string> configs;
@@ -1508,8 +1509,11 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
const std::string& linkLanguage = gt->GetLinkerLanguage(config.c_str());
// If HEADER_FILE_ONLY is set, we must suppress this generation in
// the project file
- fc.ExcludedFromBuild =
- sf.GetPropertyAsBool("HEADER_FILE_ONLY") || !cmContains(acs.Configs, ci);
+ fc.ExcludedFromBuild = sf.GetPropertyAsBool("HEADER_FILE_ONLY") ||
+ !cmContains(acs.Configs, ci) ||
+ (gt->GetPropertyAsBool("UNITY_BUILD") &&
+ sf.GetProperty("UNITY_SOURCE_FILE") &&
+ !sf.GetPropertyAsBool("SKIP_UNITY_BUILD_INCLUSION"));
if (fc.ExcludedFromBuild) {
needfc = true;
}