summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-06-08 23:14:38 +0100
committerPhil Jones <philj56@gmail.com>2022-06-09 16:51:44 +0100
commit05861ed6737f6b7b139895c4eeb26791edc333b4 (patch)
tree2f6af9e3038ec900f3968a1f2ee687f7a7238414 /meson.build
parent51bbf779ba2c9d5954e2c9470a8eae7c1ddd38a5 (diff)
Add Harfbuzz backend.
Another source of slow startup is initialising Pango. If the user supplies a ttf file, we can skip any Pango stuff and use Harfbuzz directly with Cairo to do our font rendering, providing a large speedup.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build18
1 files changed, 16 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 06ce596..4b4b100 100644
--- a/meson.build
+++ b/meson.build
@@ -48,7 +48,7 @@ add_project_arguments(
language: 'c'
)
-sources = files(
+common_sources = files(
'src/main.c',
'src/color.c',
'src/compgen.c',
@@ -62,8 +62,14 @@ sources = files(
'src/xmalloc.c',
)
+pango_sources = files('src/entry_backend/pango.c')
+harfbuzz_sources = files('src/entry_backend/harfbuzz.c')
+
cc = meson.get_compiler('c')
+libm = cc.find_library('m', required: false)
+freetype = dependency('freetype2')
glib = dependency('glib-2.0')
+harfbuzz = dependency('harfbuzz')
pangocairo = dependency('pangocairo')
wayland_client = dependency('wayland-client')
wayland_protocols = dependency('wayland-protocols', native: true)
@@ -101,8 +107,16 @@ endforeach
executable(
'tofi',
- sources, wl_proto_src, wl_proto_headers,
+ common_sources, pango_sources, wl_proto_src, wl_proto_headers,
dependencies: [glib, pangocairo, wayland_client, xkbcommon],
+ c_args: '-DUSE_PANGO',
+ install: true
+)
+
+executable(
+ 'tofi-hb',
+ common_sources, harfbuzz_sources, wl_proto_src, wl_proto_headers,
+ dependencies: [libm, glib, freetype, harfbuzz, pangocairo, wayland_client, xkbcommon],
install: true
)