diff options
author | Brad King <brad.king@kitware.com> | 2022-05-26 13:12:15 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-05-26 13:12:21 (GMT) |
commit | d45b4f59a438477106fa3cf6919f6401cda57302 (patch) | |
tree | 7d7a6bdd648ad3daca4db50adf762cec021f935e /Source | |
parent | 799a01996bac6c5ce393c28221c455d9880a5f73 (diff) | |
parent | aadaac7f6dff05c90b61079d70e304d157ea9bab (diff) | |
download | CMake-d45b4f59a438477106fa3cf6919f6401cda57302.zip CMake-d45b4f59a438477106fa3cf6919f6401cda57302.tar.gz CMake-d45b4f59a438477106fa3cf6919f6401cda57302.tar.bz2 |
Merge topic 'verify-interface-header-sets-list'
aadaac7f6d VERIFY_INTERFACE_HEADER_SETS: Add property for list of header sets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7298
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8ed7f10..ff148a2 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -8525,19 +8525,37 @@ bool cmGeneratorTarget::AddHeaderSetVerification() return true; } + auto verifyValue = this->GetProperty("INTERFACE_HEADER_SETS_TO_VERIFY"); + const bool all = verifyValue.IsEmpty(); + std::set<std::string> verifySet; + if (!all) { + auto verifyList = cmExpandedList(verifyValue); + verifySet.insert(verifyList.begin(), verifyList.end()); + } + cmTarget* verifyTarget = nullptr; auto interfaceFileSetEntries = this->Target->GetInterfaceHeaderSetsEntries(); std::set<cmFileSet*> fileSets; - auto const addFileSets = [&fileSets, this](const cmBTStringRange& entries) { - for (auto const& entry : entries) { - for (auto const& name : cmExpandedList(entry.Value)) { + for (auto const& entry : interfaceFileSetEntries) { + for (auto const& name : cmExpandedList(entry.Value)) { + if (all || verifySet.count(name)) { fileSets.insert(this->Target->GetFileSet(name)); + verifySet.erase(name); } } - }; - addFileSets(interfaceFileSetEntries); + } + if (!verifySet.empty()) { + this->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Property INTERFACE_HEADER_SETS_TO_VERIFY of target \"", + this->GetName(), + "\" contained the following header sets that are nonexistent " + "or not INTERFACE:\n ", + cmJoin(verifySet, "\n "))); + return false; + } cm::optional<std::set<std::string>> languages; for (auto* fileSet : fileSets) { |