From 90507f53c0a3a0be48cfe022f6063b770560ecbd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 4 Dec 2017 17:36:11 +0100 Subject: [PATCH] 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 --- mkspecs/features/qt_configure.prf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 44d8a3e6390..d75365cd0a9 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.