summaryrefslogtreecommitdiffstats
path: root/Source/cmStateDirectory.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-13 17:30:00 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-13 17:32:17 (GMT)
commit60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14 (patch)
tree575fad8fdaf9dd42c0d88785a5aa6b361406fe80 /Source/cmStateDirectory.cxx
parent3766633b8a49cb24f4849721bb22a0feb9ba1f60 (diff)
downloadCMake-60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14.zip
CMake-60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14.tar.gz
CMake-60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14.tar.bz2
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/cmStateDirectory.cxx')
-rw-r--r--Source/cmStateDirectory.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 4f003ed..e7de3c7 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -634,7 +634,7 @@ const char* cmStateDirectory::GetProperty(const std::string& prop,
return output.c_str();
}
- const char* retVal = this->DirectoryState->Properties.GetPropertyValue(prop);
+ cmProp retVal = this->DirectoryState->Properties.GetPropertyValue(prop);
if (!retVal && chain) {
cmStateSnapshot parentSnapshot =
this->Snapshot_.GetBuildsystemDirectoryParent();
@@ -644,7 +644,7 @@ const char* cmStateDirectory::GetProperty(const std::string& prop,
return this->Snapshot_.State->GetGlobalProperty(prop);
}
- return retVal;
+ return retVal ? retVal->c_str() : nullptr;
}
bool cmStateDirectory::GetPropertyAsBool(const std::string& prop) const