configure: query pkg-config for deps of static libs
note that pkg-config is a tad stupid: it won't tell us if the package is built statically, but one needs to explicitly ask it to output transitive deps for static packages. we can do that, as we resolve the pkg-config output to actual libraries, so we know if they are static. always asking it would print the transitive deps also if we found a dynamically linked library, which would inappropriately extend the link interface. the latter actually happens on windows (because we can't easily tell apart real static libs from import libs), but that doesn't matter, as under windows, the linker transitively resolves dlls anyway. Change-Id: If1be3b3df476374d5c8e62f4b185477c988223b3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
f7019fa43b
commit
90507f53c0
@ -709,6 +709,13 @@ defineTest(qtConfLibrary_pkgConfig) {
|
||||
eval(libs = $$libpaths $$libs)
|
||||
!qtConfResolveLibs($${1}.libs, $$libs): \
|
||||
return(false)
|
||||
contains($${1}.libs, ".*\\.$${QMAKE_EXTENSION_STATICLIB}$") {
|
||||
qtRunLoggedCommand("$$pkg_config --static --libs-only-L $$args", libpaths)|return(false)
|
||||
qtRunLoggedCommand("$$pkg_config --static --libs-only-l $$args", libs)|return(false)
|
||||
eval(libs = $$libpaths $$libs)
|
||||
!qtConfResolveLibs($${1}.libs, $$libs): \
|
||||
return(false)
|
||||
}
|
||||
|
||||
qtRunLoggedCommand("$$pkg_config --cflags $$args", $${1}.cflags)|return(false)
|
||||
# Split CFLAGS into stuff that goes into DEFINES, INCLUDEPATH, and other stuff.
|
||||
|
Loading…
x
Reference in New Issue
Block a user