summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-17 12:00:00 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-17 12:33:57 (GMT)
commitb915fec56e7b1768ea717bf4d970f8b4910c7829 (patch)
treeccbc863f50cad5ab08f30e8c0aa5c6101cb11aaa /Source/cmTarget.cxx
parentbee0100396d4b0dad7204125606e6baf26b79e38 (diff)
downloadCMake-b915fec56e7b1768ea717bf4d970f8b4910c7829.zip
CMake-b915fec56e7b1768ea717bf4d970f8b4910c7829.tar.gz
CMake-b915fec56e7b1768ea717bf4d970f8b4910c7829.tar.bz2
cmTarget: minor code improvements
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx46
1 files changed, 23 insertions, 23 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f92eea4..03f1525 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1931,7 +1931,7 @@ std::string cmTarget::ImportedGetFullPath(
std::string suffix;
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
- this->GetMappedConfig(desired_config, &loc, &imp, suffix)) {
+ this->GetMappedConfig(desired_config, loc, imp, suffix)) {
switch (artifact) {
case cmStateEnums::RuntimeBinaryArtifact:
if (loc) {
@@ -2001,7 +2001,7 @@ bool cmTargetInternals::CheckImportedLibName(std::string const& prop,
}
bool cmTarget::GetMappedConfig(std::string const& desired_config,
- const char** loc, const char** imp,
+ const char*& loc, const char*& imp,
std::string& suffix) const
{
std::string config_upper;
@@ -2039,30 +2039,30 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
// If a mapping was found, check its configurations.
for (auto mci = mappedConfigs.begin();
- !*loc && !*imp && mci != mappedConfigs.end(); ++mci) {
+ !loc && !imp && mci != mappedConfigs.end(); ++mci) {
// Look for this configuration.
if (mci->empty()) {
// An empty string in the mapping has a special meaning:
// look up the config-less properties.
- *loc = this->GetProperty(locPropBase);
+ loc = this->GetProperty(locPropBase);
if (allowImp) {
- *imp = this->GetProperty("IMPORTED_IMPLIB");
+ imp = this->GetProperty("IMPORTED_IMPLIB");
}
// If it was found, set the suffix.
- if (*loc || *imp) {
+ if (loc || imp) {
suffix.clear();
}
} else {
std::string mcUpper = cmSystemTools::UpperCase(*mci);
std::string locProp = cmStrCat(locPropBase, '_', mcUpper);
- *loc = this->GetProperty(locProp);
+ loc = this->GetProperty(locProp);
if (allowImp) {
std::string impProp = cmStrCat("IMPORTED_IMPLIB_", mcUpper);
- *imp = this->GetProperty(impProp);
+ imp = this->GetProperty(impProp);
}
// If it was found, use it for all properties below.
- if (*loc || *imp) {
+ if (loc || imp) {
suffix = cmStrCat('_', mcUpper);
}
}
@@ -2071,59 +2071,59 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
// If we needed to find one of the mapped configurations but did not
// then the target location is not found. The project does not want
// any other configuration.
- if (!mappedConfigs.empty() && !*loc && !*imp) {
+ if (!mappedConfigs.empty() && !loc && !imp) {
// Interface libraries are always available because their
- // library name is optional so it is okay to leave *loc empty.
+ // library name is optional so it is okay to leave loc empty.
return this->GetType() == cmStateEnums::INTERFACE_LIBRARY;
}
// If we have not yet found it then there are no mapped
// configurations. Look for an exact-match.
- if (!*loc && !*imp) {
+ if (!loc && !imp) {
std::string locProp = cmStrCat(locPropBase, suffix);
- *loc = this->GetProperty(locProp);
+ loc = this->GetProperty(locProp);
if (allowImp) {
std::string impProp = cmStrCat("IMPORTED_IMPLIB", suffix);
- *imp = this->GetProperty(impProp);
+ imp = this->GetProperty(impProp);
}
}
// If we have not yet found it then there are no mapped
// configurations and no exact match.
- if (!*loc && !*imp) {
+ if (!loc && !imp) {
// The suffix computed above is not useful.
suffix.clear();
// Look for a configuration-less location. This may be set by
// manually-written code.
- *loc = this->GetProperty(locPropBase);
+ loc = this->GetProperty(locPropBase);
if (allowImp) {
- *imp = this->GetProperty("IMPORTED_IMPLIB");
+ imp = this->GetProperty("IMPORTED_IMPLIB");
}
}
// If we have not yet found it then the project is willing to try
// any available configuration.
- if (!*loc && !*imp) {
+ if (!loc && !imp) {
std::vector<std::string> availableConfigs;
if (const char* iconfigs = this->GetProperty("IMPORTED_CONFIGURATIONS")) {
cmExpandList(iconfigs, availableConfigs);
}
for (auto aci = availableConfigs.begin();
- !*loc && !*imp && aci != availableConfigs.end(); ++aci) {
+ !loc && !imp && aci != availableConfigs.end(); ++aci) {
suffix = cmStrCat('_', cmSystemTools::UpperCase(*aci));
std::string locProp = cmStrCat(locPropBase, suffix);
- *loc = this->GetProperty(locProp);
+ loc = this->GetProperty(locProp);
if (allowImp) {
std::string impProp = cmStrCat("IMPORTED_IMPLIB", suffix);
- *imp = this->GetProperty(impProp);
+ imp = this->GetProperty(impProp);
}
}
}
// If we have not yet found it then the target location is not available.
- if (!*loc && !*imp) {
+ if (!loc && !imp) {
// Interface libraries are always available because their
- // library name is optional so it is okay to leave *loc empty.
+ // library name is optional so it is okay to leave loc empty.
return this->GetType() == cmStateEnums::INTERFACE_LIBRARY;
}