summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-10-22 17:29:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-24 06:42:04 (GMT)
commit030800a78a98035a1cfd95a148395bb2c442d650 (patch)
treed6153d62010011b4165702a09adce21bc0648c92 /Source/cmTarget.cxx
parente48faced66a9036cc49a31686edc8b8e92978349 (diff)
downloadCMake-030800a78a98035a1cfd95a148395bb2c442d650.zip
CMake-030800a78a98035a1cfd95a148395bb2c442d650.tar.gz
CMake-030800a78a98035a1cfd95a148395bb2c442d650.tar.bz2
cmTarget: Add a template to create correct implied content.
Otherwise, in the string case, we would get a null pointer instead of the implied empty string. That will become relevant when the comparison result is used.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ad4ae0c..f84095c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4472,6 +4472,19 @@ bool consistentProperty(const char *lhs, const char *rhs)
return strcmp(lhs, rhs) == 0;
}
+template<typename PropertyType>
+PropertyType impliedValue(PropertyType);
+template<>
+bool impliedValue<bool>(bool)
+{
+ return false;
+}
+template<>
+const char* impliedValue<const char*>(const char*)
+{
+ return "";
+}
+
//----------------------------------------------------------------------------
template<typename PropertyType>
PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt,
@@ -4547,6 +4560,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt,
}
else if (impliedByUse)
{
+ propContent = impliedValue<PropertyType>(propContent);
if (ifaceIsSet)
{
if (!consistentProperty(propContent, ifacePropContent))