From aebb900f87d6a05c473726f7e2388fe915f5dbd9 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 16 Jul 2020 10:57:40 +0200 Subject: Fix incorrect paths in prl files when doing a static build During chromium build we get some static libs, these are dependencies to QtPdf static lib. Generated prl files will contain paths to those libs. Unfortunately, these are the internal paths to the libs within the build directory. There are two solutions, merging all dependencies into final lib or simply installing static dependencies. Since doing a merge of static libs would require platform specific code and on mac requires special libtool (we use ar by default) and lipo hassle to get fat archives, we rather simply install those libs. This way seems to be a common pattern for static builds. Fixes: QTBUG-85616 Change-Id: I0cb1a0ae1ad3b8fa8af562951af4de1e9c7a8ba8 Reviewed-by: Allan Sandfeld Jensen --- src/pdf/pdfcore.pro | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/pdf/pdfcore.pro b/src/pdf/pdfcore.pro index c87722b7e..edc474105 100644 --- a/src/pdf/pdfcore.pro +++ b/src/pdf/pdfcore.pro @@ -56,6 +56,25 @@ msvc { ios: OBJECTS += $$NINJA_OBJECTS +# install static dependencies and handle prl files for static builds + +static { + ninja_archives = $$eval($$list($$NINJA_ARCHIVES)) + qqt_libdir = \$\$\$\$[QT_INSTALL_LIBS] + for(ninja_arch, ninja_archives) { + ninja_arch_name = $$basename(ninja_arch) + ninja_arch_dirname = $$dirname(ninja_arch) + ninja_arch_prl_replace_$${ninja_arch_name}.match = $${ninja_arch_dirname} + ninja_arch_prl_replace_$${ninja_arch_name}.replace = $${qqt_libdir}/static_chrome + ninja_arch_prl_replace_$${ninja_arch_name}.CONFIG = path + QMAKE_PRL_INSTALL_REPLACE += ninja_arch_prl_replace_$${ninja_arch_name} + } + ninja_archs_install.files = $${ninja_archives} + ninja_archs_install.path = $$[QT_INSTALL_LIBS]/static_chrome + ninja_archs_install.CONFIG = no_check_exist + INSTALLS += ninja_archs_install +} + SOURCES += \ qpdfbookmarkmodel.cpp \ qpdfdestination.cpp \ -- cgit v1.2.3