diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-26 17:38:57 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-26 17:38:57 (GMT) |
commit | 6d3d099b4a2d8b020fb1a9ebeb29b17b3fb6c9d6 (patch) | |
tree | 8c4dee3bfe65a0cb483896dd9b187452a63ad3b7 /Source/cmTarget.cxx | |
parent | 0db9d9278760c90be1fbf5c4eeb93ef9c524041a (diff) | |
download | CMake-6d3d099b4a2d8b020fb1a9ebeb29b17b3fb6c9d6.zip CMake-6d3d099b4a2d8b020fb1a9ebeb29b17b3fb6c9d6.tar.gz CMake-6d3d099b4a2d8b020fb1a9ebeb29b17b3fb6c9d6.tar.bz2 |
cmGeneratorTarget: Move ComputeLinkInterfaceLibraries from cmTarget.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 153 |
1 files changed, 0 insertions, 153 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 00dbc6a..9e9aed4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -77,13 +77,11 @@ public: cmTargetInternals() : Backtrace() { - this->PolicyWarnedCMP0022 = false; this->UtilityItemsDone = false; } cmTargetInternals(cmTargetInternals const&) : Backtrace() { - this->PolicyWarnedCMP0022 = false; this->UtilityItemsDone = false; } ~cmTargetInternals(); @@ -95,7 +93,6 @@ public: LinkInterfaceMapType; LinkInterfaceMapType LinkInterfaceMap; LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap; - bool PolicyWarnedCMP0022; typedef std::map<std::string, cmTarget::OutputInfo> OutputInfoMapType; OutputInfoMapType OutputInfoMap; @@ -4166,156 +4163,6 @@ cmTarget::GetImportLinkInterface(const std::string& config, } //---------------------------------------------------------------------------- -void -cmTarget::ComputeLinkInterfaceLibraries( - const std::string& config, - cmOptionalLinkInterface& iface, - cmTarget const* headTarget, - bool usage_requirements_only) const -{ - // Construct the property name suffix for this configuration. - std::string suffix = "_"; - if(!config.empty()) - { - suffix += cmSystemTools::UpperCase(config); - } - else - { - suffix += "NOCONFIG"; - } - - // An explicit list of interface libraries may be set for shared - // libraries and executables that export symbols. - const char* explicitLibraries = 0; - std::string linkIfaceProp; - if(this->GetPolicyStatusCMP0022() != cmPolicies::OLD && - this->GetPolicyStatusCMP0022() != cmPolicies::WARN) - { - // CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES. - linkIfaceProp = "INTERFACE_LINK_LIBRARIES"; - explicitLibraries = this->GetProperty(linkIfaceProp); - } - else if(this->GetType() == cmTarget::SHARED_LIBRARY || - this->IsExecutableWithExports()) - { - // CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a - // shared lib or executable. - - // Lookup the per-configuration property. - linkIfaceProp = "LINK_INTERFACE_LIBRARIES"; - linkIfaceProp += suffix; - explicitLibraries = this->GetProperty(linkIfaceProp); - - // If not set, try the generic property. - if(!explicitLibraries) - { - linkIfaceProp = "LINK_INTERFACE_LIBRARIES"; - explicitLibraries = this->GetProperty(linkIfaceProp); - } - } - - if(explicitLibraries && - this->GetPolicyStatusCMP0022() == cmPolicies::WARN && - !this->Internal->PolicyWarnedCMP0022) - { - // Compare the explicitly set old link interface properties to the - // preferred new link interface property one and warn if different. - const char* newExplicitLibraries = - this->GetProperty("INTERFACE_LINK_LIBRARIES"); - if (newExplicitLibraries - && strcmp(newExplicitLibraries, explicitLibraries) != 0) - { - std::ostringstream w; - w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0022) << "\n" - "Target \"" << this->GetName() << "\" has an " - "INTERFACE_LINK_LIBRARIES property which differs from its " << - linkIfaceProp << " properties." - "\n" - "INTERFACE_LINK_LIBRARIES:\n" - " " << newExplicitLibraries << "\n" << - linkIfaceProp << ":\n" - " " << (explicitLibraries ? explicitLibraries : "(empty)") << "\n"; - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); - this->Internal->PolicyWarnedCMP0022 = true; - } - } - - // There is no implicit link interface for executables or modules - // so if none was explicitly set then there is no link interface. - if(!explicitLibraries && - (this->GetType() == cmTarget::EXECUTABLE || - (this->GetType() == cmTarget::MODULE_LIBRARY))) - { - return; - } - iface.Exists = true; - iface.ExplicitLibraries = explicitLibraries; - - if(explicitLibraries) - { - // The interface libraries have been explicitly set. - this->ExpandLinkItems(linkIfaceProp, explicitLibraries, config, - headTarget, usage_requirements_only, - iface.Libraries, - iface.HadHeadSensitiveCondition); - } - else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN - || this->GetPolicyStatusCMP0022() == cmPolicies::OLD) - // If CMP0022 is NEW then the plain tll signature sets the - // INTERFACE_LINK_LIBRARIES, so if we get here then the project - // cleared the property explicitly and we should not fall back - // to the link implementation. - { - // The link implementation is the default link interface. - cmLinkImplementationLibraries const* impl = - this->GetLinkImplementationLibrariesInternal(config, headTarget); - iface.Libraries.insert(iface.Libraries.end(), - impl->Libraries.begin(), impl->Libraries.end()); - if(this->GetPolicyStatusCMP0022() == cmPolicies::WARN && - !this->Internal->PolicyWarnedCMP0022 && !usage_requirements_only) - { - // Compare the link implementation fallback link interface to the - // preferred new link interface property and warn if different. - std::vector<cmLinkItem> ifaceLibs; - static const std::string newProp = "INTERFACE_LINK_LIBRARIES"; - if(const char* newExplicitLibraries = this->GetProperty(newProp)) - { - bool hadHeadSensitiveConditionDummy = false; - this->ExpandLinkItems(newProp, newExplicitLibraries, config, - headTarget, usage_requirements_only, - ifaceLibs, hadHeadSensitiveConditionDummy); - } - if (ifaceLibs != iface.Libraries) - { - std::string oldLibraries = cmJoin(impl->Libraries, ";"); - std::string newLibraries = cmJoin(ifaceLibs, ";"); - if(oldLibraries.empty()) - { oldLibraries = "(empty)"; } - if(newLibraries.empty()) - { newLibraries = "(empty)"; } - - std::ostringstream w; - w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0022) << "\n" - "Target \"" << this->GetName() << "\" has an " - "INTERFACE_LINK_LIBRARIES property. " - "This should be preferred as the source of the link interface " - "for this library but because CMP0022 is not set CMake is " - "ignoring the property and using the link implementation " - "as the link interface instead." - "\n" - "INTERFACE_LINK_LIBRARIES:\n" - " " << newLibraries << "\n" - "Link implementation:\n" - " " << oldLibraries << "\n"; - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); - this->Internal->PolicyWarnedCMP0022 = true; - } - } - } -} - - -//---------------------------------------------------------------------------- void cmTargetInternals::AddInterfaceEntries( cmTarget const* thisTarget, std::string const& config, std::string const& prop, std::vector<TargetPropertyEntry*>& entries) |