summaryrefslogtreecommitdiff
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-05-25 14:33:38 -0400
committerKyle Edwards <kyle.edwards@kitware.com>2022-05-25 14:37:27 -0400
commitaadaac7f6dff05c90b61079d70e304d157ea9bab (patch)
tree620bdfa228029ece66b674bf9d06272e0ca867d1 /Source/cmGeneratorTarget.cxx
parent5dcf505f63037e23094146730704b031c57c5d06 (diff)
downloadcmake-aadaac7f6dff05c90b61079d70e304d157ea9bab.tar.gz
VERIFY_INTERFACE_HEADER_SETS: Add property for list of header sets
Add a new property, INTERFACE_HEADER_SETS_TO_VERIFY, which contains a list of header sets that should be verified by VERIFY_INTERFACE_HEADER_SETS. Fixes: #23522
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx28
1 files changed, 23 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 8ed7f1046a..ff148a2d9e 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) {