[CMake] static libraries and symbol resolution

Steven Wilson steven.wesley.wilson at gmail.com
Tue Nov 10 14:50:44 EST 2009


Never mind, I figured out how to do it...

You can use target_link_libraries() (because target_link_libraries also
accepts linker options) to do this kind of thing:

target_link_libraries(FOO -Wl,--start-group A B C -Wl,--end-group)



On Tue, Nov 10, 2009 at 12:30 PM, Steven Wilson <
steven.wesley.wilson at gmail.com> wrote:

> I have a group of static archive libraries (.a libs) on Linux and because
> of the way the linker does symbol resolution I need to use the
> -Wl,--start-group and -Wl,--end-group linker options to group these
> libraries.   These linker options tell the linker to continue searching the
> libraries for symbols until all symbol resolution is accomplished.   On the
> command line these options need to appear like the following(or some
> equivalent variant thereof): -Wl,--start-group libA.a libB.a libC.a ...
> -Wl,--end-group.   I can put something together with CMake that can
> construct a custom command line to do this kind of thing, but I wanted to
> check and see if someone knew a good way to make this happen with CMake
> before I started.
>
> Thanks,
>
> Steve
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091110/8d6e17be/attachment.htm>


More information about the CMake mailing list