mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 22:00:10 -05:00
cmTarget: Improve code style
Rename `desired_config` argument of `GetMappedConfig[New]` to `desiredConfig`, in accordance with our specified style preferences.
This commit is contained in:
+11
-11
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user