aboutsummarylogtreecommitdiffstats
path: root/0013-Fix-linking-against-external-harfbuzz.patch
blob: 738b8664bd72dbf6929126a43bff1dd52880c17f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From e08f71f26c964c3f5a82eb208d871fc883869f23 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 14:22:56 +0200
Subject: [PATCH 13/26] Fix linking against external harfbuzz

---
 config.tests/unix/harfbuzz/harfbuzz.pro | 3 ++-
 src/3rdparty/harfbuzz_dependency.pri    | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/config.tests/unix/harfbuzz/harfbuzz.pro b/config.tests/unix/harfbuzz/harfbuzz.pro
index 32edd6e358..cc40fc1678 100644
--- a/config.tests/unix/harfbuzz/harfbuzz.pro
+++ b/config.tests/unix/harfbuzz/harfbuzz.pro
@@ -1,3 +1,4 @@
 SOURCES = harfbuzz.cpp
 CONFIG -= qt dylib
-LIBS += -lharfbuzz
+contains(CONFIG, static): LIBS += $$system($$PKG_CONFIG --static --libs harfbuzz)
+else: LIBS += $$system($$PKG_CONFIG --libs harfbuzz)
diff --git a/src/3rdparty/harfbuzz_dependency.pri b/src/3rdparty/harfbuzz_dependency.pri
index 74433688f6..2932f059e9 100644
--- a/src/3rdparty/harfbuzz_dependency.pri
+++ b/src/3rdparty/harfbuzz_dependency.pri
@@ -2,5 +2,7 @@ contains(QT_CONFIG, harfbuzz) {
     INCLUDEPATH += $$PWD/harfbuzz-ng/include
     LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtharfbuzzng$$qtPlatformTargetSuffix()
 } else:contains(QT_CONFIG, system-harfbuzz) {
-    LIBS_PRIVATE += -lharfbuzz
+    # can't use 'feature' link_pkgconfig here because it would add harfbuzz to LIBS rather than LIBS_PRIVATE
+    contains(QT_CONFIG, static): LIBS_PRIVATE += $$system($$PKG_CONFIG --static --libs harfbuzz)
+    else: LIBS_PRIVATE += $$system($$PKG_CONFIG --libs harfbuzz)
 }
-- 
2.11.0