[cmake-developers] CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS and CMP0065

Brad King brad.king at kitware.com
Thu Oct 6 13:54:48 EDT 2016


On 10/06/2016 01:45 PM, Stephen Kelly wrote:
> I have encountered the implementation of CMP0065. As far as I can see, this 
> is the only use of CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS, and it is not 
> used for shared libraries, but for executables.

Correct.  It was about exporting symbols from executables so plugins can
see them.  See the policy docs.

> Am I missing something or is that also used for shared libraries? Or should 
> the variable be renamed? Or should CMP0065 be using some other appropriate 
> variable?

The variable name refers to flags needed when linking an executable *to*
shared libraries.  It is a terrible name that has been around since the
earliest days.  One could rename the variable in our own platform files
but would have to also honor the old name just in case.

> Also, shouldn't that code be part of cmComputeLinkInformation? It seems out 
> of place in cmLocalGenerator. If it were returned from cli.GetItems, then 
> cmLocalVisualStudio7GeneratorInternals::OutputLibraries and 
> cmGlobalXCodeGenerator::AddDependAndLinkInformation would make use of it, 
> which as far as I can tell they currently do not. Should/do those generators 
> support ENABLE_EXPORTS?

Yes, it could be moved.  It hasn't really mattered because the variable
is not populated on the platforms supported by those other generators.

-Brad



More information about the cmake-developers mailing list