From e12e5e056610c5768fd04fbed22937989a5aba2c Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Oct 2024 13:10:13 -0400 Subject: cmGeneratorTarget: Simplify ComputeVersionedName signature --- Source/cmGeneratorTarget.cxx | 34 ++++++++++++++++++---------------- Source/cmGeneratorTarget.h | 8 +++++--- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 20c5dca..b99f01f 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3438,14 +3438,14 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetLibraryNames( cmStrCat(components.prefix, targetNames.Base, components.suffix); } else { // The library's soname. - this->ComputeVersionedName(targetNames.SharedObject, components.prefix, - targetNames.Base, components.suffix, - targetNames.Output, soversion); + targetNames.SharedObject = this->ComputeVersionedName( + components.prefix, targetNames.Base, components.suffix, + targetNames.Output, soversion); // The library's real name on disk. - this->ComputeVersionedName(targetNames.Real, components.prefix, - targetNames.Base, components.suffix, - targetNames.Output, version); + targetNames.Real = this->ComputeVersionedName( + components.prefix, targetNames.Base, components.suffix, + targetNames.Output, version); } // The import library names. @@ -3468,14 +3468,13 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetLibraryNames( targetNames.ImportLibrary = targetNames.ImportOutput; } else { // The import library's soname. - this->ComputeVersionedName( - targetNames.ImportLibrary, importComponents.prefix, - importComponents.base, importComponents.suffix, - targetNames.ImportOutput, soversion); + targetNames.ImportLibrary = this->ComputeVersionedName( + importComponents.prefix, importComponents.base, + importComponents.suffix, targetNames.ImportOutput, soversion); // The import library's real name on disk. - this->ComputeVersionedName( - targetNames.ImportReal, importComponents.prefix, importComponents.base, + targetNames.ImportReal = this->ComputeVersionedName( + importComponents.prefix, importComponents.base, importComponents.suffix, targetNames.ImportOutput, version); } } @@ -4155,16 +4154,19 @@ std::string cmGeneratorTarget::GetFrameworkVersion() const return "A"; } -void cmGeneratorTarget::ComputeVersionedName( - std::string& vName, std::string const& prefix, std::string const& base, - std::string const& suffix, std::string const& name, cmValue version) const +std::string cmGeneratorTarget::ComputeVersionedName(std::string const& prefix, + std::string const& base, + std::string const& suffix, + std::string const& name, + cmValue version) const { - vName = this->IsApple() ? (prefix + base) : name; + std::string vName = this->IsApple() ? (prefix + base) : name; if (version) { vName += "."; vName += *version; } vName += this->IsApple() ? suffix : std::string(); + return vName; } std::vector cmGeneratorTarget::GetPropertyKeys() const diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 525cef0..8ae98e8 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -1182,9 +1182,11 @@ private: // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type. const char* GetOutputTargetType(cmStateEnums::ArtifactType artifact) const; - void ComputeVersionedName(std::string& vName, std::string const& prefix, - std::string const& base, std::string const& suffix, - std::string const& name, cmValue version) const; + std::string ComputeVersionedName(std::string const& prefix, + std::string const& base, + std::string const& suffix, + std::string const& name, + cmValue version) const; mutable std::map CustomTransitiveBuildPropertiesMap; -- cgit v0.12