summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-11-09 03:28:18 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2019-11-11 13:10:18 (GMT)
commit9a5418320ea40d61a63fd47e5ac133c3ff780062 (patch)
treea3acc27189bb2d5b0b8d1f3d792826bc45a6e1f5 /Source/cmLocalGenerator.cxx
parent929d7a454c8069bae4dece36838ed0db6b65d9cf (diff)
downloadCMake-9a5418320ea40d61a63fd47e5ac133c3ff780062.zip
CMake-9a5418320ea40d61a63fd47e5ac133c3ff780062.tar.gz
CMake-9a5418320ea40d61a63fd47e5ac133c3ff780062.tar.bz2
Unity: Don't include sources with HEADER_FILE_ONLY property set
Fixes: #19946 Fixes: #19947 Co-authored-by: Craig Scott <craig.scott@crascit.com>
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index cae47e0..5d2c927 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2441,6 +2441,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
std::back_inserter(filtered_sources), [&](cmSourceFile* sf) {
return sf->GetLanguage() == lang &&
!sf->GetPropertyAsBool("SKIP_UNITY_BUILD_INCLUSION") &&
+ !sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
!sf->GetProperty("COMPILE_OPTIONS") &&
!sf->GetProperty("COMPILE_DEFINITIONS") &&
!sf->GetProperty("COMPILE_FLAGS") &&
@@ -2475,11 +2476,10 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
cmSourceFile* sf = filtered_sources[begin];
// Only in Visual Studio generator we keep the source files
- // for explicit processing. For the rest the source files will
- // not be included in the project.
+ // for explicit processing.
if (!this->GetGlobalGenerator()->IsMultiConfig() ||
this->GetGlobalGenerator()->IsXcode()) {
- sf->SetProperty("HEADER_FILE_ONLY", "ON");
+ target->AddSourceFileToUnityBatch(sf->ResolveFullPath());
}
sf->SetProperty("UNITY_SOURCE_FILE", filename.c_str());