summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/meson.build2
-rw-r--r--meson.build19
-rw-r--r--pango-view/meson.build4
-rw-r--r--pango/meson.build2
-rw-r--r--tests/meson.build2
-rw-r--r--tools/meson.build12
6 files changed, 27 insertions, 14 deletions
diff --git a/docs/meson.build b/docs/meson.build
index 40154bac..c784149e 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -59,7 +59,7 @@ html_images = [
docdeps = [ libpango_dep ]
-if freetype_dep.found()
+if build_pangoft2
docdeps += libpangoft2_dep
endif
diff --git a/meson.build b/meson.build
index f2045315..5133d5c1 100644
--- a/meson.build
+++ b/meson.build
@@ -235,7 +235,10 @@ endif
# The first version of freetype with a pkg-config file is 2.1.5
# We require both fontconfig and freetype if we are to have either.
freetype_dep = dependency('freetype2', required: false)
-if freetype_dep.found() and fontconfig_dep.found()
+
+# To build pangoft2, we need HarfBuzz, FontConfig and FreeType
+build_pangoft2 = harfbuzz_dep.found() and fontconfig_dep.found() and freetype_dep.found()
+if build_pangoft2
pango_conf.set('HAVE_FREETYPE', 1)
pango_deps += freetype_dep
endif
@@ -267,6 +270,7 @@ if cairo_dep.found()
# - version
# - define
# - backend name
+ # Note that Cairo can be built with FreeType but without FontConfig
cairo_font_backends = [
[ 'cairo-ft', cairo_req_version, 'HAVE_CAIRO_FREETYPE', 'freetype', ],
[ 'cairo-win32', cairo_req_version, 'HAVE_CAIRO_WIN32', 'win32', ],
@@ -278,8 +282,15 @@ if cairo_dep.found()
foreach b: cairo_font_backends
dep = dependency(b[0], version: b[1], required: false)
if dep.found()
- pango_conf.set(b[2], 1)
- pango_font_backends += b[3]
+ if b[0] == 'cairo-ft'
+ if build_pangoft2
+ pango_conf.set(b[2], 1)
+ pango_font_backends += b[3]
+ endif
+ else
+ pango_conf.set(b[2], 1)
+ pango_font_backends += b[3]
+ endif
endif
endforeach
@@ -336,7 +347,7 @@ pkgconf.set('PKGCONFIG_CAIRO_REQUIRES', pangocairo_requires)
pkgconf_files = [
[ 'pango.pc' ],
[ 'pangowin32.pc', host_system == 'windows' ],
- [ 'pangoft2.pc', freetype_dep.found() ],
+ [ 'pangoft2.pc', build_pangoft2 ],
[ 'pangoxft.pc', xft_dep.found() ],
[ 'pangocairo.pc', cairo_dep.found() ],
]
diff --git a/pango-view/meson.build b/pango-view/meson.build
index b7aa634b..c607f719 100644
--- a/pango-view/meson.build
+++ b/pango-view/meson.build
@@ -9,12 +9,12 @@ pango_view_deps = [
libpango_dep,
]
-if freetype_dep.found()
+if build_pangoft2
pango_view_sources += 'viewer-pangoft2.c'
pango_view_deps += libpangoft2_dep
endif
-if xft_dep.found()
+if xft_dep.found() and build_pangoft2
pango_view_sources += [
'viewer-pangoxft.c',
'viewer-x.c',
diff --git a/pango/meson.build b/pango/meson.build
index 93f0740a..3312d72d 100644
--- a/pango/meson.build
+++ b/pango/meson.build
@@ -154,7 +154,7 @@ libpango_dep = declare_dependency(
)
# FreeType
-if freetype_dep.found()
+if build_pangoft2
pangoft2_headers = [
'pango-ot.h',
'pangofc-font.h',
diff --git a/tests/meson.build b/tests/meson.build
index a4df3bc0..bceb9093 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -24,7 +24,7 @@ tests = [
[ 'cxx-test', [ 'cxx-test.cpp' ] ],
]
-if freetype_dep.found()
+if build_pangoft2
test_cflags += '-DHAVE_FREETYPE'
tests += [
[ 'test-ot-tags', [ 'test-ot-tags.c' ], [ libpangoft2_dep ] ],
diff --git a/tools/meson.build b/tools/meson.build
index 37a3be76..37e52434 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -1,5 +1,7 @@
-executable('gen-script-for-lang', 'gen-script-for-lang.c',
- dependencies: pango_deps + [ libpango_dep ],
- c_args: common_cflags + pango_debug_cflags + [ '-DPANGO_DISABLE_DEPRECATED' ],
- include_directories: root_inc,
- install: false)
+if fontconfig_dep.found()
+ executable('gen-script-for-lang', 'gen-script-for-lang.c',
+ dependencies: pango_deps + [ libpango_dep ],
+ c_args: common_cflags + pango_debug_cflags + [ '-DPANGO_DISABLE_DEPRECATED' ],
+ include_directories: root_inc,
+ install: false)
+endif