summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt_configure.prf
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-12-04 17:36:11 +0100
committerLars Schmertmann <lars.schmertmann@governikus.de>2018-12-07 15:20:30 +0000
commit90507f53c0a3a0be48cfe022f6063b770560ecbd (patch)
treef19f762cac338f3451cdf8006c2ae16c66a9322f /mkspecs/features/qt_configure.prf
parentf7019fa43bca4ec26f76a4c4975cbb53b2886902 (diff)
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>
Diffstat (limited to 'mkspecs/features/qt_configure.prf')
-rw-r--r--mkspecs/features/qt_configure.prf7
1 files changed, 7 insertions, 0 deletions
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 44d8a3e639..d75365cd0a 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -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.