summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2020-07-16 10:57:40 +0200
committerMichal Klocek <michal.klocek@qt.io>2020-07-21 20:08:31 +0200
commitaebb900f87d6a05c473726f7e2388fe915f5dbd9 (patch)
treede166f2bd8354c36b8ed1e80f64e65fea6f241d1
parent9c5608e4e4b600581ed17c0a6b2dc316bb1544d0 (diff)
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 <allan.jensen@qt.io>
-rw-r--r--src/pdf/pdfcore.pro19
1 files changed, 19 insertions, 0 deletions
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 \