summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-07 19:12:58 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-07 19:22:12 (GMT)
commitf1fb63b306ad06a8931ca5a00a2b9ce9e66bc12e (patch)
treed2da200fd32bb7913ebc24de9672acf890bad907 /Source/cmLocalGenerator.cxx
parentead89868ba09bb331ae31c116f1cec4a44713b3b (diff)
downloadCMake-f1fb63b306ad06a8931ca5a00a2b9ce9e66bc12e.zip
CMake-f1fb63b306ad06a8931ca5a00a2b9ce9e66bc12e.tar.gz
CMake-f1fb63b306ad06a8931ca5a00a2b9ce9e66bc12e.tar.bz2
file(GENERATE): Create output file structures even earlier
Since commit b80557c7bd (file(GENERATE): Evaluate early to allow generating source files, 2014-11-04, v3.2.0-rc1~398^2) we create the `cmSourceFile` instances marked with a `GENERATED` source file property before tracing source dependencies. Move it to even earlier so that steps in `cmGlobalGenerator::AddAutomaticSources` can operate on all sources. This also avoids the accidental `O(n^2)` calls for `n` local generators that we had previously. This is also needed since commit 83c1657ff7 (Unity build: Generate sources during Compute step, 2019-10-03) to support `file(GENERATE)` outputs as sources in a target with `UNITY_BUILD` enabled.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ccd70a3..fc027f6 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -263,11 +263,6 @@ static void MoveSystemIncludesToEnd(std::vector<BT<std::string>>& includeDirs,
void cmLocalGenerator::TraceDependencies()
{
- std::vector<std::string> const& configs =
- this->Makefile->GetGeneratorConfigs();
- for (std::string const& c : configs) {
- this->GlobalGenerator->CreateEvaluationSourceFiles(c);
- }
// Generate the rule files for each target.
const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
for (cmGeneratorTarget* target : targets) {
@@ -360,6 +355,15 @@ void cmLocalGenerator::GenerateTestFiles()
}
}
+void cmLocalGenerator::CreateEvaluationFileOutputs()
+{
+ std::vector<std::string> const& configs =
+ this->Makefile->GetGeneratorConfigs();
+ for (std::string const& c : configs) {
+ this->CreateEvaluationFileOutputs(c);
+ }
+}
+
void cmLocalGenerator::CreateEvaluationFileOutputs(std::string const& config)
{
std::vector<cmGeneratorExpressionEvaluationFile*> ef =