From 702b7fda494b8ec6d2f1cb590039a5088062951c Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Wed, 27 Aug 2025 16:10:38 -0400 Subject: [PATCH] cmTarget: Improve code style Rename `desired_config` argument of `GetMappedConfig[New]` to `desiredConfig`, in accordance with our specified style preferences. --- Source/cmTarget.cxx | 22 +++++++++++----------- Source/cmTarget.h | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b9b0d1f669..5ad2e6ff9a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3210,7 +3210,7 @@ bool cmTargetInternals::CheckImportedLibName(std::string const& prop, return true; } -bool cmTarget::GetMappedConfig(std::string const& desired_config, cmValue& loc, +bool cmTarget::GetMappedConfig(std::string const& desiredConfig, cmValue& loc, cmValue& imp, std::string& suffix) const { switch (this->GetPolicyStatusCMP0200()) { @@ -3221,9 +3221,9 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, cmValue& loc, } CM_FALLTHROUGH; case cmPolicies::OLD: - return this->GetMappedConfigOld(desired_config, loc, imp, suffix); + return this->GetMappedConfigOld(desiredConfig, loc, imp, suffix); case cmPolicies::NEW: - return this->GetMappedConfigNew(desired_config, loc, imp, suffix); + return this->GetMappedConfigNew(desiredConfig, loc, imp, suffix); } cmValue newLoc; @@ -3231,9 +3231,9 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, cmValue& loc, std::string newSuffix; bool const newResult = - this->GetMappedConfigNew(desired_config, newLoc, newImp, newSuffix); + this->GetMappedConfigNew(desiredConfig, newLoc, newImp, newSuffix); - if (!this->GetMappedConfigOld(desired_config, loc, imp, suffix)) { + if (!this->GetMappedConfigOld(desiredConfig, loc, imp, suffix)) { if (newResult) { // NEW policy found a configuration, OLD did not. auto newConfig = cm::string_view{ newSuffix }.substr(1); @@ -3446,15 +3446,15 @@ bool cmTarget::GetLocation(std::string const& config, cmValue& loc, return loc || imp || (this->GetType() == cmStateEnums::INTERFACE_LIBRARY); } -bool cmTarget::GetMappedConfigNew(std::string const& desired_config, +bool cmTarget::GetMappedConfigNew(std::string const& desiredConfig, cmValue& loc, cmValue& imp, std::string& suffix) const { // Get configuration mapping, if present. cmList mappedConfigs; - if (!desired_config.empty()) { + if (!desiredConfig.empty()) { std::string mapProp = cmStrCat("MAP_IMPORTED_CONFIG_", - cmSystemTools::UpperCase(desired_config)); + cmSystemTools::UpperCase(desiredConfig)); if (cmValue mapValue = this->GetProperty(mapProp)) { mappedConfigs.assign(*mapValue, cmList::EmptyElements::Yes); } @@ -3478,8 +3478,8 @@ bool cmTarget::GetMappedConfigNew(std::string const& desired_config, } // There is no mapping; try the requested configuration first. - if (cm::contains(availableConfigs, desired_config)) { - this->GetLocation(desired_config, loc, imp, suffix); + if (cm::contains(availableConfigs, desiredConfig)) { + this->GetLocation(desiredConfig, loc, imp, suffix); return true; } @@ -3504,7 +3504,7 @@ bool cmTarget::GetMappedConfigNew(std::string const& desired_config, // There is no mapping and no explicit list of configurations; the only // configuration left to try is the requested configuration. - if (this->GetLocation(desired_config, loc, imp, suffix)) { + if (this->GetLocation(desiredConfig, loc, imp, suffix)) { return true; } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 9cf80866e5..fe948bc3e7 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -234,7 +234,7 @@ public: bool IsRuntimeBinary() const; bool CanCompileSources() const; - bool GetMappedConfig(std::string const& desired_config, cmValue& loc, + bool GetMappedConfig(std::string const& desiredConfig, cmValue& loc, cmValue& imp, std::string& suffix) const; //! Return whether this target is an executable with symbol exports enabled. @@ -352,7 +352,7 @@ private: bool GetMappedConfigOld(std::string const& desired_config, cmValue& loc, cmValue& imp, std::string& suffix) const; - bool GetMappedConfigNew(std::string const& desired_config, cmValue& loc, + bool GetMappedConfigNew(std::string const& desiredConfig, cmValue& loc, cmValue& imp, std::string& suffix) const; cmValue GetLocation(std::string const& base, std::string const& suffix) const;