From 91dee46497241d75269d2742d761c913dcaea059 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 26 Apr 2017 17:10:15 +0100 Subject: [PATCH] build: Use get_pkgconfig_variable() There's no need to run pkg-config ourselves. --- gtk/meson.build | 15 ++++----------- modules/input/meson.build | 27 ++++++++++++++++----------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/gtk/meson.build b/gtk/meson.build index a948d069a9..02c352fb4d 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -811,22 +811,15 @@ gtk_deps = [ atk_dep, epoxy_dep, libm, - graphene_dep + graphene_dep, ] if x11_enabled - runcmd = run_command('pkg-config', '--variable=prefix', 'x11') - if runcmd.returncode() == 0 - gtk_cargs += '-DX11_DATA_PREFIX="' + runcmd.stdout().strip() + '"' - else - error('Could not get x11 data prefix via pkg-config.') - endif + x11_data_prefix = dependency('x11').get_pkgconfig_variable('prefix') + gtk_cargs += [ '-DX11_DATA_PREFIX="@0@"'.format(x11_data_prefix), ] gtk_sources += gtk_x11_sources - gtk_deps += [ - xi_dep, - x11_dep, - ] + gtk_deps += [ xi_dep, x11_dep, ] endif if wayland_enabled diff --git a/modules/input/meson.build b/modules/input/meson.build index 43c3262165..0111790c73 100644 --- a/modules/input/meson.build +++ b/modules/input/meson.build @@ -8,21 +8,26 @@ build_dynamic_modules = false disable_modules = get_option('disable-modules') if not disable_modules - runcmd = run_command('pkg-config', '--variable=gmodule_supported', 'gmodule-no-export-2.0') - if runcmd.returncode() == 0 - gmodule_supported = runcmd.stdout().strip() - if gmodule_supported == 'true' - build_dynamic_modules = true - else - message('Modules are not supported according to gmodule-no-export-2.0.pc') - endif + gmodule_supported = dependency('gmodule-no-export-2.0').get_pkgconfig_variable('gmodule_supported') + if gmodule_supported == 'true' + build_dynamic_modules = true else - message('WARNING: failed to query if modules are supported!') + message('Modules are not supported according to gmodule-no-export-2.0.pc') endif endif -all_immodules = ['am-et', 'cedilla', 'cyrillic-translit', 'inuktitut', - 'ipa', 'multipress', 'thai', 'ti-er', 'ti-et', 'viqr'] +all_immodules = [ + 'am-et', + 'cedilla', + 'cyrillic-translit', + 'inuktitut', + 'ipa', + 'multipress', + 'thai', + 'ti-er', + 'ti-et', + 'viqr', +] all_immodules += backend_immodules