[CMake] target_link_libraries replacing fully-qualified library with -l<x>

Nils Gladitz nilsgladitz at gmail.com
Thu Jan 29 10:53:57 EST 2015


On 01/29/2015 04:36 PM, Brad King wrote:
>
> If you link tothis library using a full path manually, what is recorded
> in the NEEDED field of the resulting binary?  Without SONAME many linkers
> record the full path.  Does INPUT avoid that?
>
> Thanks,
> -Brad
>

The actual library referenced by INPUT() [1] does have a SONAME so that 
is what should show up as a NEEDED entry.

I am not entirely sure what would happen if the referenced library did 
not have a SONAME.

I'd say that would be out of scope for cmake though since it is not 
responsible for the content of the linker script nor can it reasonably 
influence its interpretation.

Perhaps failing to read a SONAME should imply that a SONAME is available 
(in context of cmComputeLinkInformation).

Might be easier/more reliable than guessing if the given file is 
actually a linker script?

Nils

[1] https://sourceware.org/binutils/docs/ld/File-Commands.html


More information about the CMake mailing list