[cmake-developers] CMake 2.8.12 transitive link regression?

Brad King brad.king at kitware.com
Thu Oct 31 15:40:00 EDT 2013


On 10/31/2013 02:43 PM, Brad King wrote:
> I think what we need to do is when only the plain tll signature
> is used, cmTarget and cmExportFileGenerator logic should behave
> as if INTERFACE_LINK_LIBRARIES were always set to the link
> implementation and LINK_INTERFACE_LIBRARIES is set to the link
> implementation when CMP0022 is not NEW.

I think your current change edits the wrong place.  This block:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmTarget.cxx;hb=v2.8.12#l6591

is the culprit for this regression.  It will be reached exactly
when only the plain tll signature is used because all other
signatures set the link interface explicitly:

  if(explicitLibraries)
    {
    ...
    }
  else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN
        || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
    // The implementation shouldn't be the interface if CMP0022 is NEW. That
    // way, the LINK_LIBRARIES property can be set directly without having to
    // empty the INTERFACE_LINK_LIBRARIES
    {
    // The link implementation is the default link interface.
    LinkImplementation const* impl = this->GetLinkImplementation(config,
                                                              headTarget);
    iface.ImplementationIsInterface = true;
    iface.Libraries = impl->Libraries;
    iface.WrongConfigLibraries = impl->WrongConfigLibraries;
    if(this->LinkLanguagePropagatesToDependents())
      {
      // Targets using this archive need its language runtime libraries.
      iface.Languages = impl->Languages;
      }
    }

Can you explain what the comment about LINK_LIBRARIES means?

It is the logic here that needs to trigger regardless of the CMP0022
setting, and then the export logic must deal with the case that the
implementation is the interface both for populating the new and
old interface properties.

-Brad



More information about the cmake-developers mailing list