diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-08-04 13:08:17 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-08-08 14:19:08 (GMT) |
commit | e5cd39ca80c8c234118ded33a1576c1be281aa9e (patch) | |
tree | 0494dad04188959dd6cefc9497688718ff88006b /Source/cmMakefile.cxx | |
parent | 350065bb855a26692ed6af04870f144ae1f6a886 (diff) | |
download | CMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.zip CMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.tar.gz CMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.tar.bz2 |
cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties,
introduce the class cmProp as a replacement from the simple pointer
to std::string instance.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6d477a7..0b8778f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2579,12 +2579,7 @@ cmProp cmMakefile::GetDefinition(const std::string& name) const const std::string& cmMakefile::GetSafeDefinition(const std::string& name) const { - static std::string const empty; - cmProp def = this->GetDefinition(name); - if (!def) { - return empty; - } - return *def; + return this->GetDefinition(name); } bool cmMakefile::GetDefExpandList(const std::string& name, @@ -2967,7 +2962,7 @@ MessageType cmMakefile::ExpandVariablesInStringNew( break; case ENVIRONMENT: if (cmSystemTools::GetEnv(lookup, svalue)) { - value = &svalue; + value = cmProp(svalue); } break; case CACHE: @@ -4012,7 +4007,7 @@ cmProp cmMakefile::GetProperty(const std::string& prop) const return pair.first; }); output = cmJoin(keys, ";"); - return &output; + return cmProp(output); } return this->StateSnapshot.GetDirectory().GetProperty(prop); |