diff options
author | Brad King <brad.king@kitware.com> | 2022-03-30 13:10:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-03-30 13:10:25 (GMT) |
commit | a7b325e203a45f3c8d4a64fd3338079e0a14e250 (patch) | |
tree | 9d971930a86c4b98cca7883137599df19f6ebf58 /Source/cmGlobalGenerator.cxx | |
parent | 1e2338458053082f254170f5fa579cf4c54d69d3 (diff) | |
parent | c798744f8193e97f00f1b6e47dc5bc6fdc34b222 (diff) | |
download | CMake-a7b325e203a45f3c8d4a64fd3338079e0a14e250.zip CMake-a7b325e203a45f3c8d4a64fd3338079e0a14e250.tar.gz CMake-a7b325e203a45f3c8d4a64fd3338079e0a14e250.tar.bz2 |
Merge topic 'verify-header-sets'
c798744f81 FILE_SET: Add VERIFY_HEADER_SETS target property
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7085
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 fb84cd1..3c31db1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1501,6 +1501,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; @@ -1722,6 +1727,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) { |