ENH: More robust property lookup
This teaches cmMakefile::GetProperty and cmake::GetProperty methods to return NULL when the property name is NULL, making them more robust and consistent with the behavior of cmTarget::GetProperty.
This commit is contained in:
parent
cc2092d5bb
commit
7d6a5e097f
|
@ -3162,6 +3162,10 @@ const char *cmMakefile::GetProperty(const char* prop)
|
||||||
const char *cmMakefile::GetProperty(const char* prop,
|
const char *cmMakefile::GetProperty(const char* prop,
|
||||||
cmProperty::ScopeType scope)
|
cmProperty::ScopeType scope)
|
||||||
{
|
{
|
||||||
|
if(!prop)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
// watch for specific properties
|
// watch for specific properties
|
||||||
static std::string output;
|
static std::string output;
|
||||||
output = "";
|
output = "";
|
||||||
|
|
|
@ -3606,6 +3606,10 @@ const char *cmake::GetProperty(const char* prop)
|
||||||
|
|
||||||
const char *cmake::GetProperty(const char* prop, cmProperty::ScopeType scope)
|
const char *cmake::GetProperty(const char* prop, cmProperty::ScopeType scope)
|
||||||
{
|
{
|
||||||
|
if(!prop)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
bool chain = false;
|
bool chain = false;
|
||||||
|
|
||||||
// watch for special properties
|
// watch for special properties
|
||||||
|
|
Loading…
Reference in New Issue