summaryrefslogtreecommitdiff
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-13 13:30:00 -0400
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-13 13:32:17 -0400
commit60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14 (patch)
tree575fad8fdaf9dd42c0d88785a5aa6b361406fe80 /Source/cmTarget.cxx
parent3766633b8a49cb24f4849721bb22a0feb9ba1f60 (diff)
downloadcmake-60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14.tar.gz
cmPropertyMap: Introduce cmProp as return type for GetProperty() functions
Currently properties are usually stored internally as `std::string`. However, family of GetProperty() functions return them as `const char *` using `c_str()`. The proposed `cmProp`, typedef'ed as `const std::string *` will expose properties more naturally.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 10515c2365..0b01cda95a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1771,7 +1771,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
}
}
- const char* retVal = impl->Properties.GetPropertyValue(prop);
+ cmProp retVal = impl->Properties.GetPropertyValue(prop);
if (!retVal) {
const bool chain =
impl->Makefile->GetState()->IsPropertyChained(prop, cmProperty::TARGET);
@@ -1779,8 +1779,9 @@ const char* cmTarget::GetProperty(const std::string& prop) const
return impl->Makefile->GetStateSnapshot().GetDirectory().GetProperty(
prop, chain);
}
+ return nullptr;
}
- return retVal;
+ return retVal->c_str();
}
const char* cmTarget::GetSafeProperty(const std::string& prop) const