[pango] meson: Ensure we generate the appropriate pkg-config files



commit 6b6d6f0afa7d1b3bdca2e72c2b77b01c00f0e543
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon May 22 20:40:17 2017 +0100

    meson: Ensure we generate the appropriate pkg-config files
    
    The Pango pkg-config files are generated depending on the platform we
    are building for, and backends we are using. Only the `pango.pc` file is
    generated unconditionally.

 meson.build |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/meson.build b/meson.build
index 2571ccc..1a0ff0e 100644
--- a/meson.build
+++ b/meson.build
@@ -344,12 +344,25 @@ pkgconf.set('VERSION', meson.project_version())
 pkgconf.set('PANGO_API_VERSION', pango_api_version)
 pkgconf.set('PKGCONFIG_CAIRO_REQUIRES', pangocairo_requires)
 
-foreach pkg: [ 'pango.pc', 'pangowin32.pc', 'pangoft2.pc', 'pangoxft.pc', 'pangocairo.pc', ]
-  configure_file(input: '@0@.in'.format(pkg),
-                 output: pkg,
-                 configuration: pkgconf,
-                 install: true,
-                 install_dir: join_paths(pango_libdir, 'pkgconfig'))
+pkgconf_files = [
+  [ 'pango.pc' ],
+  [ 'pangowin32.pc', host_system == 'windows' ],
+  [ 'pangoft2.pc', freetype_dep.found() ],
+  [ 'pangoxft.pc', xft_dep.found() ],
+  [ 'pangocairo.pc', cairo_dep.found() ],
+]
+
+foreach pkg: pkgconf_files
+  pkg_name = pkg[0]
+  pkg_enabled = pkg.get(1, true)
+
+  if pkg_enabled
+    configure_file(input: pkg_name + '.in',
+                   output: pkg_name,
+                   configuration: pkgconf,
+                   install: true,
+                   install_dir: join_paths(pango_libdir, 'pkgconfig'))
+  endif
 endforeach
 
 gnome = import('gnome')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]