summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-21 15:26:10 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-21 15:26:10 (GMT)
commitfe665fdda8986b3af061ec91a7ab5fbe8f606e4f (patch)
treec6c6d69affe62ca56ce803d2d8b18a9631eecd02 /Source/cmTarget.cxx
parent9d13e1679f2b52e88748a710edd201ed9fba7447 (diff)
downloadCMake-fe665fdda8986b3af061ec91a7ab5fbe8f606e4f.zip
CMake-fe665fdda8986b3af061ec91a7ab5fbe8f606e4f.tar.gz
CMake-fe665fdda8986b3af061ec91a7ab5fbe8f606e4f.tar.bz2
cmTarget: Refactor link interface map storage
Convert LinkInterfaceMapType and LinkImplMapType to nested maps that index on configuration first and 'head' target second.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx35
1 files changed, 17 insertions, 18 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index dc8384d..52b7e68 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -88,11 +88,6 @@ struct cmTarget::CompileInfo
std::string CompilePdbDir;
};
-struct TargetConfigPair : public std::pair<cmTarget const* , std::string> {
- TargetConfigPair(cmTarget const* tgt, const std::string &config)
- : std::pair<cmTarget const* , std::string>(tgt, config) {}
-};
-
//----------------------------------------------------------------------------
class cmTargetInternals
{
@@ -135,7 +130,9 @@ public:
cmTarget const* head,
bool usage_requirements_only);
- typedef std::map<TargetConfigPair, OptionalLinkInterface>
+ struct HeadToLinkInterfaceMap:
+ public std::map<cmTarget const*, OptionalLinkInterface> {};
+ typedef std::map<std::string, HeadToLinkInterfaceMap>
LinkInterfaceMapType;
LinkInterfaceMapType LinkInterfaceMap;
LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap;
@@ -158,8 +155,10 @@ public:
bool LibrariesDone;
bool LanguagesDone;
};
- typedef std::map<TargetConfigPair,
- OptionalLinkImplementation> LinkImplMapType;
+ struct HeadToLinkImplementationMap:
+ public std::map<cmTarget const*, OptionalLinkImplementation> {};
+ typedef std::map<std::string,
+ HeadToLinkImplementationMap> LinkImplMapType;
LinkImplMapType LinkImplMap;
typedef std::map<std::string, cmTarget::LinkClosure> LinkClosureMapType;
@@ -5746,10 +5745,10 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
}
// Lookup any existing link interface for this configuration.
- TargetConfigPair key(head, cmSystemTools::UpperCase(config));
+ std::string CONFIG = cmSystemTools::UpperCase(config);
cmTargetInternals::OptionalLinkInterface&
- iface = this->Internal->LinkInterfaceMap[key];
+ iface = this->Internal->LinkInterfaceMap[CONFIG][head];
if(!iface.LibrariesDone)
{
iface.LibrariesDone = true;
@@ -5789,13 +5788,13 @@ cmTarget::GetLinkInterfaceLibraries(const std::string& config,
}
// Lookup any existing link interface for this configuration.
- TargetConfigPair key(head, cmSystemTools::UpperCase(config));
+ std::string CONFIG = cmSystemTools::UpperCase(config);
cmTargetInternals::LinkInterfaceMapType& lim =
(usage_requirements_only ?
this->Internal->LinkInterfaceUsageRequirementsOnlyMap :
this->Internal->LinkInterfaceMap);
- cmTargetInternals::OptionalLinkInterface& iface = lim[key];
+ cmTargetInternals::OptionalLinkInterface& iface = lim[CONFIG][head];
if(!iface.LibrariesDone)
{
iface.LibrariesDone = true;
@@ -5818,13 +5817,13 @@ cmTarget::GetImportLinkInterface(const std::string& config,
return 0;
}
- TargetConfigPair key(headTarget, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkInterfaceMapType& lim =
(usage_requirements_only ?
this->Internal->LinkInterfaceUsageRequirementsOnlyMap :
this->Internal->LinkInterfaceMap);
- cmTargetInternals::OptionalLinkInterface& iface = lim[key];
+ std::string CONFIG = cmSystemTools::UpperCase(config);
+ cmTargetInternals::OptionalLinkInterface& iface = lim[CONFIG][headTarget];
if(!iface.AllDone)
{
iface.AllDone = true;
@@ -6226,9 +6225,9 @@ cmTarget::GetLinkImplementation(const std::string& config) const
}
// Populate the link implementation for this configuration.
- TargetConfigPair key(this, cmSystemTools::UpperCase(config));
+ std::string CONFIG = cmSystemTools::UpperCase(config);
cmTargetInternals::OptionalLinkImplementation&
- impl = this->Internal->LinkImplMap[key];
+ impl = this->Internal->LinkImplMap[CONFIG][this];
if(!impl.LibrariesDone)
{
impl.LibrariesDone = true;
@@ -6261,9 +6260,9 @@ cmTarget::GetLinkImplementationLibrariesInternal(const std::string& config,
}
// Populate the link implementation libraries for this configuration.
- TargetConfigPair key(head, cmSystemTools::UpperCase(config));
+ std::string CONFIG = cmSystemTools::UpperCase(config);
cmTargetInternals::OptionalLinkImplementation&
- impl = this->Internal->LinkImplMap[key];
+ impl = this->Internal->LinkImplMap[CONFIG][head];
if(!impl.LibrariesDone)
{
impl.LibrariesDone = true;