mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 11:49:55 -06:00
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.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user