summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6fade3e..6249c28 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2266,7 +2266,10 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target,
for (; begin != end; ++begin) {
cmSourceFile* sf = filtered_sources[begin];
- sf->SetProperty("HEADER_FILE_ONLY", "ON");
+ if (!this->GetGlobalGenerator()->IsMultiConfig()) {
+ sf->SetProperty("HEADER_FILE_ONLY", "ON");
+ }
+ sf->SetProperty("UNITY_SOURCE_FILE", filename.c_str());
if (beforeInclude) {
file << beforeInclude << "\n";
@@ -2283,6 +2286,10 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target,
cmSystemTools::RemoveFile(filename_tmp);
target->AddSource(filename, true);
+
+ auto unity = this->Makefile->GetOrCreateSource(filename);
+ unity->SetProperty("SKIP_UNITY_BUILD_INCLUSION", "ON");
+ unity->SetProperty("UNITY_SOURCE_FILE", filename.c_str());
}
}
}