summaryrefslogtreecommitdiff
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx59
1 files changed, 31 insertions, 28 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index d852b4856f..8a7215b127 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -335,20 +335,6 @@ EvaluatedTargetPropertyEntries EvaluateTargetPropertyEntries(
cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
: Target(t)
- , FortranModuleDirectoryCreated(false)
- , SourceFileFlagsConstructed(false)
- , PolicyWarnedCMP0022(false)
- , PolicyReportedCMP0069(false)
- , DebugIncludesDone(false)
- , DebugCompileOptionsDone(false)
- , DebugCompileFeaturesDone(false)
- , DebugCompileDefinitionsDone(false)
- , DebugLinkOptionsDone(false)
- , DebugLinkDirectoriesDone(false)
- , DebugPrecompileHeadersDone(false)
- , DebugSourcesDone(false)
- , UtilityItemsDone(false)
- , SourcesAreContextDependent(Tribool::Indeterminate)
{
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = lg;
@@ -447,7 +433,7 @@ cmValue cmGeneratorTarget::GetProperty(const std::string& prop) const
cmTargetPropertyComputer::GetProperty(this, prop, *this->Makefile)) {
return result;
}
- if (cmSystemTools::GetFatalErrorOccured()) {
+ if (cmSystemTools::GetFatalErrorOccurred()) {
return nullptr;
}
return this->Target->GetProperty(prop);
@@ -2775,15 +2761,14 @@ cmGeneratorTarget::LinkClosure const* cmGeneratorTarget::GetLinkClosure(
class cmTargetSelectLinker
{
- int Preference;
+ int Preference = 0;
cmGeneratorTarget const* Target;
cmGlobalGenerator* GG;
std::set<std::string> Preferred;
public:
cmTargetSelectLinker(cmGeneratorTarget const* target)
- : Preference(0)
- , Target(target)
+ : Target(target)
{
this->GG = this->Target->GetLocalGenerator()->GetGlobalGenerator();
}
@@ -5713,7 +5698,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
if (emitted.insert(p).second) {
getLinkInterfaceDependentProperty<PropertyType>(depender, p, config, t,
nullptr);
- if (cmSystemTools::GetErrorOccuredFlag()) {
+ if (cmSystemTools::GetErrorOccurredFlag()) {
return;
}
}
@@ -5792,25 +5777,25 @@ void cmGeneratorTarget::CheckPropertyCompatibility(
checkPropertyConsistency<bool>(this, dep.Target, strBool, emittedBools,
config, BoolType, nullptr);
- if (cmSystemTools::GetErrorOccuredFlag()) {
+ if (cmSystemTools::GetErrorOccurredFlag()) {
return;
}
checkPropertyConsistency<const char*>(this, dep.Target, strString,
emittedStrings, config, StringType,
nullptr);
- if (cmSystemTools::GetErrorOccuredFlag()) {
+ if (cmSystemTools::GetErrorOccurredFlag()) {
return;
}
checkPropertyConsistency<const char*>(this, dep.Target, strNumMin,
emittedMinNumbers, config,
NumberMinType, nullptr);
- if (cmSystemTools::GetErrorOccuredFlag()) {
+ if (cmSystemTools::GetErrorOccurredFlag()) {
return;
}
checkPropertyConsistency<const char*>(this, dep.Target, strNumMax,
emittedMaxNumbers, config,
NumberMaxType, nullptr);
- if (cmSystemTools::GetErrorOccuredFlag()) {
+ if (cmSystemTools::GetErrorOccurredFlag()) {
return;
}
}
@@ -8540,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) {