summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-05 15:37:49 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-26 17:46:32 (GMT)
commitd4a24c0e953e0032a2e483917850b7f8f387bbb2 (patch)
treec4ee40746dcf84e0565a86da3293d20b7f8094e7 /Source/cmGeneratorTarget.cxx
parent83981cf5931aaa2d9bbf4f99ea55c99736173fdf (diff)
downloadCMake-d4a24c0e953e0032a2e483917850b7f8f387bbb2.zip
CMake-d4a24c0e953e0032a2e483917850b7f8f387bbb2.tar.gz
CMake-d4a24c0e953e0032a2e483917850b7f8f387bbb2.tar.bz2
cmGeneratorTarget: Move GetLinkImplementation from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx31
1 files changed, 28 insertions, 3 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 057aa07..44fac1d 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1336,7 +1336,7 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config,
// Get languages built in this target.
UNORDERED_SET<std::string> languages;
cmLinkImplementation const* impl =
- this->Target->GetLinkImplementation(config);
+ this->GetLinkImplementation(config);
assert(impl);
for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
li != impl->Languages.end(); ++li)
@@ -4058,7 +4058,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
if (this->GetType() != cmTarget::INTERFACE_LIBRARY)
{
cmLinkImplementation const* impl =
- this->Target->GetLinkImplementation(config);
+ this->GetLinkImplementation(config);
for(std::vector<cmLinkImplItem>::const_iterator
li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li)
{
@@ -4099,7 +4099,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
{
// Targets using this archive need its language runtime libraries.
if(cmLinkImplementation const* impl =
- this->Target->GetLinkImplementation(config))
+ this->GetLinkImplementation(config))
{
iface.Languages = impl->Languages;
}
@@ -4389,3 +4389,28 @@ cmGeneratorTarget::GetHeadToLinkInterfaceUsageRequirementsMap(
std::string CONFIG = cmSystemTools::UpperCase(config);
return this->LinkInterfaceUsageRequirementsOnlyMap[CONFIG];
}
+
+//----------------------------------------------------------------------------
+const cmLinkImplementation *
+cmGeneratorTarget::GetLinkImplementation(const std::string& config) const
+{
+ // There is no link implementation for imported targets.
+ if(this->Target->IsImported())
+ {
+ return 0;
+ }
+
+ cmOptionalLinkImplementation& impl = this->Target->GetLinkImplMap(config);
+ if(!impl.LibrariesDone)
+ {
+ impl.LibrariesDone = true;
+ this->Target->ComputeLinkImplementationLibraries(config, impl,
+ this->Target);
+ }
+ if(!impl.LanguagesDone)
+ {
+ impl.LanguagesDone = true;
+ this->Target->ComputeLinkImplementationLanguages(config, impl);
+ }
+ return &impl;
+}