diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-04-30 14:00:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-30 14:27:16 (GMT) |
commit | 53675adbcf2f485d68c45e53d28baf6db220264c (patch) | |
tree | 8d0d761714de6f0a8f7c512f1af05e2f6bde493b /Source/cmTarget.cxx | |
parent | c09efe074d793203ab846e97bde8d03e4714dc2a (diff) | |
download | CMake-53675adbcf2f485d68c45e53d28baf6db220264c.zip CMake-53675adbcf2f485d68c45e53d28baf6db220264c.tar.gz CMake-53675adbcf2f485d68c45e53d28baf6db220264c.tar.bz2 |
GetSafeProperty: return std::string const&
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 10 |
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 |