[QBS] Enclosing a library product in special linker flags

Kandeler Christian Christian.Kandeler at theqtcompany.com
Thu Nov 6 16:21:16 CET 2014


> I have a project with an application and a couple of static libary products
> as dependencies. When it comes to linking, I need all symbols of one library
> to be linked into the executable. This can be achieved with the
> --whole-archive flag. The following line applies this flag to only one library:
>
> g++ ... lib1.a lib2.a -Wl--whole-archive lib3.a -Wl,--no-whole-archive ...
>
> Has anybody an idea, how to create such a pattern with qbs?

Order of options is indeed a bit of a problem, as the code that puts them together more or less assumes that the order does not matter, which is not true for programs like ld.
Off the top of my head, I don't know how to achieve the above. It's particularly complicated due to the "grouping" requirement (--start-group/--end-group is the same thing conceptually). Perhaps such things will need dedicated properties (where?) with special handling? Ideas welcome. Perhaps we should gather them in a JIRA task.


Christian



More information about the Qbs mailing list