[QBS] Wrong ld arguments depending on source files

Ilya Lyubimov villytiger at gmail.com
Sat Apr 4 10:39:47 CEST 2015


I have a directory called crypto in my project. At the same time I
want to link my product with crypto library. The problem is that
linkerFlags function from gcc.js looks for file with library name and
having found crypto directory (I think it would be wrong behaviour
even if crypto was a regular file) it doesn't pass "-l" argument. So
in this situation the only option is to pass linkerFlags manually.
I think a possible solution for this issue would be to split
staticLibraries and dynamicLibraries properties into properties for
libraries by name and properties for libraries by path, or use ":"
prefix, as ld with "-l" argument do, for passing libraries by path.

And another question is about linking static libraries. As far as I
can see in source code there is no any difference between
staticLibraries and dynamicLibraries properties. When I use
staticLibraries property, I want to be sure that it will at least
prefer static libraries or won't link dynamic libraries at all. But
"-l" option of ld by default prefer dynamic libraries to static ones.
May be it's better to link static libraries like this
""-Wl,--push-state,-Bstatic -lcrypto -Wl,--pop-state", to be sure that
static version of library was linked.

-- 
С уважением, / Best regards
Любимов Илья / Ilya Lyubimov



More information about the Qbs mailing list