diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-02-24 18:09:53 -0500 |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-03-29 13:58:27 -0400 |
commit | c798744f8193e97f00f1b6e47dc5bc6fdc34b222 (patch) | |
tree | 27b2dc2cbd04d45026319bbe006acd72bb0f3dff /Source/cmGlobalGenerator.cxx | |
parent | fdbef2a2be1f070e0f0809536639ff20d80584e6 (diff) | |
download | cmake-c798744f8193e97f00f1b6e47dc5bc6fdc34b222.tar.gz |
FILE_SET: Add VERIFY_HEADER_SETS target property
Fixes: #23338
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index baa54e58a0..b869308f80 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1499,6 +1499,11 @@ bool cmGlobalGenerator::Compute() return false; } + // Iterate through all targets and add verification targets for header sets + if (!this->AddHeaderSetVerification()) { + return false; + } + // Iterate through all targets and set up AUTOMOC, AUTOUIC and AUTORCC if (!this->QtAutoGen()) { return false; @@ -1720,6 +1725,27 @@ bool cmGlobalGenerator::QtAutoGen() #endif } +bool cmGlobalGenerator::AddHeaderSetVerification() +{ + for (auto const& gen : this->LocalGenerators) { + // Because AddHeaderSetVerification() adds generator targets, we need to + // cache the existing list of generator targets before starting. + std::vector<cmGeneratorTarget*> genTargets; + genTargets.reserve(gen->GetGeneratorTargets().size()); + for (auto const& tgt : gen->GetGeneratorTargets()) { + genTargets.push_back(tgt.get()); + } + + for (auto* tgt : genTargets) { + if (!tgt->AddHeaderSetVerification()) { + return false; + } + } + } + + return true; +} + bool cmGlobalGenerator::AddAutomaticSources() { for (const auto& lg : this->LocalGenerators) { |