summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-12-07 14:03:16 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2019-12-07 14:44:38 (GMT)
commitfa93b4a59bd639c995ffdf8a5c41dc587c160716 (patch)
treeb7adad006caae1acba0339f1ed96b2c5073afbbe /Source
parent5ae07e7166c6cb7eada2a2d171d216039d977058 (diff)
downloadCMake-fa93b4a59bd639c995ffdf8a5c41dc587c160716.zip
CMake-fa93b4a59bd639c995ffdf8a5c41dc587c160716.tar.gz
CMake-fa93b4a59bd639c995ffdf8a5c41dc587c160716.tar.bz2
Unity: Proper handling of object libraries
Fixes: #20051
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx9
-rw-r--r--Source/cmLocalGenerator.cxx2
2 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b7f8990..09fb87d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1567,6 +1567,15 @@ bool cmGlobalGenerator::AddAutomaticSources()
lg->AddPchDependencies(gt);
}
}
+ // The above transformations may have changed the classification of sources.
+ // Clear the source list and classification cache (KindedSources) of all
+ // targets so that it will be recomputed correctly by the generators later
+ // now that the above transformations are done for all targets.
+ for (cmLocalGenerator* lg : this->LocalGenerators) {
+ for (cmGeneratorTarget* gt : lg->GetGeneratorTargets()) {
+ gt->ClearSourcesCache();
+ }
+ }
return true;
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b211c34..8d7b350 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2307,6 +2307,7 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
}
const std::string buildType = cmSystemTools::UpperCase(config);
+ // FIXME: Refactor collection of sources to not evaluate object libraries.
std::vector<cmSourceFile*> sources;
target->GetSourceFiles(sources, buildType);
@@ -2469,6 +2470,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles/",
target->GetName(), ".dir/Unity/");
+ // FIXME: Refactor collection of sources to not evaluate object libraries.
std::vector<cmSourceFile*> sources;
target->GetSourceFiles(sources, buildType);