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/cmSourceFile.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/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 3f3c8d5..f2b5cc4 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -342,7 +342,7 @@ cmProp cmSourceFile::GetPropertyForUser(const std::string& prop) // if it is requested by the user. if (prop == propLANGUAGE) { // The pointer is valid until `this->Language` is modified. - return &this->GetOrDetermineLanguage(); + return cmProp(this->GetOrDetermineLanguage()); } // Special handling for GENERATED property. @@ -355,9 +355,9 @@ cmProp cmSourceFile::GetPropertyForUser(const std::string& prop) (policyStatus == cmPolicies::WARN || policyStatus == cmPolicies::OLD) ? CheckScope::GlobalAndLocal : CheckScope::Global)) { - return &propTRUE; + return cmProp(propTRUE); } - return &propFALSE; + return cmProp(propFALSE); } // Perform the normal property lookup. @@ -371,7 +371,7 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const if (this->FullPath.empty()) { return nullptr; } - return &this->FullPath; + return cmProp(this->FullPath); } // Check for the properties with backtraces. @@ -382,7 +382,7 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->IncludeDirectories, ";"); - return &output; + return cmProp(output); } if (prop == propCOMPILE_OPTIONS) { @@ -392,7 +392,7 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->CompileOptions, ";"); - return &output; + return cmProp(output); } if (prop == propCOMPILE_DEFINITIONS) { @@ -402,7 +402,7 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->CompileDefinitions, ";"); - return &output; + return cmProp(output); } cmProp retVal = this->Properties.GetPropertyValue(prop); |