summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 955a5cc..a776398 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1789,13 +1789,15 @@ cmProp cmTarget::GetProperty(const std::string& prop) const
return retVal;
}
-const char* cmTarget::GetSafeProperty(const std::string& prop) const
+std::string const& cmTarget::GetSafeProperty(std::string const& prop) const
{
cmProp ret = this->GetProperty(prop);
- if (!ret) {
- return "";
+ if (ret) {
+ return *ret;
}
- return ret->c_str();
+
+ static std::string const s_empty;
+ return s_empty;
}
bool cmTarget::GetPropertyAsBool(const std::string& prop) const