From 030800a78a98035a1cfd95a148395bb2c442d650 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 22 Oct 2013 19:29:57 +0200 Subject: 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. --- Source/cmTarget.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 +PropertyType impliedValue(PropertyType); +template<> +bool impliedValue(bool) +{ + return false; +} +template<> +const char* impliedValue(const char*) +{ + return ""; +} + //---------------------------------------------------------------------------- template PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt, @@ -4547,6 +4560,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt, } else if (impliedByUse) { + propContent = impliedValue(propContent); if (ifaceIsSet) { if (!consistentProperty(propContent, ifacePropContent)) -- cgit v0.12