gtk/meson.build: Fix builds without PangoFT2
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 5 Jan 2022 09:50:29 +0000 (17:50 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 12 Jan 2022 09:29:28 +0000 (17:29 +0800)
We aren't really using PangoFT2 for [language|script]-names.c, and are
always using items from them, so make sure they are being built.

Also always include the pangoft2 dependency in gtk_dep if it is found.

gtk/meson.build

index 09a6e0bc84a08df7be18c2933b31f5342a0e3e61..9e012015227bcfeb8db3b575830a0415d5a26d60 100644 (file)
@@ -1072,6 +1072,10 @@ gtk_gen_headers = [
   gtkversion,
 ]
 
+font_script_language_sources = files([
+  'language-names.c',
+])
+
 gtk_sources += [
   gtk_a11y_src,
   gtk_dbus_src,
@@ -1081,6 +1085,7 @@ gtk_sources += [
   gtkmarshalers,
   gtkprivatetypebuiltins,
   gtktypebuiltins,
+  font_script_language_sources,
 ]
 
 gtk_deps = [
@@ -1097,13 +1102,6 @@ gtk_deps = [
   graphene_dep,
 ]
 
-if harfbuzz_dep.found() and pangoft_dep.found()
-  gtk_deps += [ harfbuzz_dep, pangoft_dep ]
-  gtk_sources += files([
-  'language-names.c',
-  ])
-endif
-
 if x11_enabled
   x11_data_prefix = dependency('x11').get_variable(pkgconfig: 'prefix')
 
@@ -1151,6 +1149,9 @@ endif
 # So we don't add these twice
 if x11_enabled or wayland_enabled
   gtk_sources += gtk_use_wayland_or_x11_c_sources
+endif
+
+if pangoft_dep.found()
   gtk_deps += pangoft_dep
 endif