[CMake] transitive link flags

Luke Dalessandro luked at cs.rochester.edu
Sun Nov 6 14:19:24 EST 2011


On Nov 6, 2011, at 2:12 PM, Łukasz Tasz wrote:

> hi
> 
> (target_link_libraries yourlib -Wl,--wrap,symbol) is not dooing the job?

I am trying to do it on the (add_library foo ...) side, since that's the context that knows what symbols to link. Doing it on the (target_link_libraries) side requires that I mess around with a bunch of files every time my set of wrapped symbols needs to change---a process prone to error. I was expecting there to be an existing target property that I could use for the information, but that doesn't seem true.

As it is, I've written my own macro for linking with this particular library, essentially a custom target_link_libraries command: target_link_foo, that contains the right flags. This is basically unsatisfactory though, since I need to remember to use it and just hope everyone else does too.

Luke

> 
> ragards
> Lukasz
> 
> 
> 2011/11/6 Luke Dalessandro <luked at cs.rochester.edu>:
>> Hi everyone,
>> 
>> I have a static library target that has some sources that rely on link-time symbol interposition.
>> 
>> Is there an existing way to set transitive link flags of the "-Wl,--wrap,symbol" variety on the library target so that executables that depend on the library are automatically linked correctly?
>> 
>> Thanks,
>> Luke
>> --
>> 
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>> 
> 
> 
> 
> -- 
> Lukasz Tasz



More information about the CMake mailing list