diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-01-29 17:40:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-29 19:31:01 (GMT) |
commit | bbc07e456193a90562635d7baa1f82c4dc0bd1cb (patch) | |
tree | e9862bfdc1f87c06678efc8dabd31a7e72142789 /Source/cmGeneratorTarget.cxx | |
parent | feea34e7eb483e8db28947920757612a95ab1863 (diff) | |
download | CMake-bbc07e456193a90562635d7baa1f82c4dc0bd1cb.zip CMake-bbc07e456193a90562635d7baa1f82c4dc0bd1cb.tar.gz CMake-bbc07e456193a90562635d7baa1f82c4dc0bd1cb.tar.bz2 |
Source: use std::string in place of const char*
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index c525a6e..4dfc33d 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -54,11 +54,11 @@ const char* cmTargetPropertyComputer::GetSources<cmGeneratorTarget>( cmGeneratorTarget const* tgt, cmMessenger* /* messenger */, cmListFileBacktrace const& /* context */) { - return tgt->GetSourcesProperty(); + return tgt->GetSourcesProperty().c_str(); } template <> -const char* +const std::string& cmTargetPropertyComputer::ComputeLocationForBuild<cmGeneratorTarget>( cmGeneratorTarget const* tgt) { @@ -66,7 +66,8 @@ cmTargetPropertyComputer::ComputeLocationForBuild<cmGeneratorTarget>( } template <> -const char* cmTargetPropertyComputer::ComputeLocation<cmGeneratorTarget>( +const std::string& +cmTargetPropertyComputer::ComputeLocation<cmGeneratorTarget>( cmGeneratorTarget const* tgt, const std::string& config) { return tgt->GetLocation(config); @@ -310,7 +311,7 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) cmGeneratorTarget::~cmGeneratorTarget() = default; -const char* cmGeneratorTarget::GetSourcesProperty() const +const std::string& cmGeneratorTarget::GetSourcesProperty() const { std::vector<std::string> values; for (auto& se : this->SourceEntries) { @@ -319,7 +320,7 @@ const char* cmGeneratorTarget::GetSourcesProperty() const static std::string value; value.clear(); value = cmJoin(values, ";"); - return value.c_str(); + return value; } cmGlobalGenerator* cmGeneratorTarget::GetGlobalGenerator() const @@ -996,7 +997,8 @@ void cmGeneratorTarget::GetXamlSources(std::vector<cmSourceFile const*>& data, IMPLEMENT_VISIT(SourceKindXaml); } -const char* cmGeneratorTarget::GetLocation(const std::string& config) const +const std::string& cmGeneratorTarget::GetLocation( + const std::string& config) const { static std::string location; if (this->IsImported()) { @@ -1005,7 +1007,7 @@ const char* cmGeneratorTarget::GetLocation(const std::string& config) const } else { location = this->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact); } - return location.c_str(); + return location; } std::vector<cmCustomCommand> const& cmGeneratorTarget::GetPreBuildCommands() @@ -1036,13 +1038,13 @@ bool cmGeneratorTarget::IsImportedGloballyVisible() const return this->Target->IsImportedGloballyVisible(); } -const char* cmGeneratorTarget::GetLocationForBuild() const +const std::string& cmGeneratorTarget::GetLocationForBuild() const { static std::string location; if (this->IsImported()) { location = this->Target->ImportedGetFullPath( "", cmStateEnums::RuntimeBinaryArtifact); - return location.c_str(); + return location; } // Now handle the deprecated build-time configuration location. @@ -1062,7 +1064,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const } location += "/"; location += this->GetFullName("", cmStateEnums::RuntimeBinaryArtifact); - return location.c_str(); + return location; } bool cmGeneratorTarget::IsSystemIncludeDirectory( |