diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-02-06 23:47:31 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-02-07 15:21:09 (GMT) |
commit | 655e98bf7149eb3757a0587409076326edeb9c04 (patch) | |
tree | 71053ab3498e53f16c5800314326f3408a6586ea /Source/cmTarget.cxx | |
parent | 46e28960a58a25bbf0124b6ab95eda24cc4fe1a4 (diff) | |
download | CMake-655e98bf7149eb3757a0587409076326edeb9c04.zip CMake-655e98bf7149eb3757a0587409076326edeb9c04.tar.gz CMake-655e98bf7149eb3757a0587409076326edeb9c04.tar.bz2 |
Ensure type specific compatible interface properties do not intersect.
Before, the boolean version would always win, and the string one would
be ignored.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 4109929..b92bf77 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -906,7 +906,10 @@ void cmTarget::DefineProperties(cmake *cm) "consistent with each other, and with the \"FOO\" property in the " "dependee. Consistency in this sense has the meaning that if the " "property is set, then it must have the same boolean value as all " - "others, and if the property is not set, then it is ignored."); + "others, and if the property is not set, then it is ignored. Note that " + "for each dependee, the set of properties from this property must not " + "intersect with the set of properties from the " + "COMPATIBLE_INTERFACE_STRING property."); cm->DefineProperty ("COMPATIBLE_INTERFACE_STRING", cmProperty::TARGET, @@ -917,7 +920,10 @@ void cmTarget::DefineProperties(cmake *cm) "if a property \"FOO\" appears in the list, then for each dependee, the " "\"INTERFACE_FOO\" property content in all of its dependencies must be " "equal with each other, and with the \"FOO\" property in the dependee. " - "If the property is not set, then it is ignored."); + "If the property is not set, then it is ignored. Note that for each " + "dependee, the set of properties from this property must not intersect " + "with the set of properties from the COMPATIBLE_INTERFACE_BOOL " + "property."); cm->DefineProperty ("POST_INSTALL_SCRIPT", cmProperty::TARGET, @@ -5616,7 +5622,8 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, { const cmComputeLinkInformation::ItemVector &deps = info->GetItems(); - std::set<cmStdString> emitted; + std::set<cmStdString> emittedBools; + std::set<cmStdString> emittedStrings; for(cmComputeLinkInformation::ItemVector::const_iterator li = deps.begin(); @@ -5629,19 +5636,36 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, checkPropertyConsistency<bool>(this, li->Target, "COMPATIBLE_INTERFACE_BOOL", - emitted, config, 0); + emittedBools, config, 0); if (cmSystemTools::GetErrorOccuredFlag()) { return; } checkPropertyConsistency<const char *>(this, li->Target, "COMPATIBLE_INTERFACE_STRING", - emitted, config, 0); + emittedStrings, config, 0); if (cmSystemTools::GetErrorOccuredFlag()) { return; } } + + for(std::set<cmStdString>::const_iterator li = emittedBools.begin(); + li != emittedBools.end(); ++li) + { + const std::set<cmStdString>::const_iterator si = emittedStrings.find(*li); + if (si != emittedStrings.end()) + { + cmOStringStream e; + e << "Property \"" << *li << "\" appears in both the " + "COMPATIBLE_INTERFACE_BOOL and the COMPATIBLE_INTERFACE_STRING " + "property in the dependencies of target \"" << this->GetName() << + "\". This is not allowed. A property may only require compatibility " + "in a boolean interpretation or a string interpretation, but not both."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + break; + } + } } //---------------------------------------------------------------------------- |