From: Fred Morcos Date: Fri, 18 Aug 2023 22:17:29 +0000 (+0200) Subject: Meson: Cleanup the pgsql dependency detection X-Git-Tag: rec-5.1.0-alpha1~80^2~183 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a9c6e3a8c73aa6daf835b96dee445c537e1c70e;p=thirdparty%2Fpdns.git Meson: Cleanup the pgsql dependency detection --- diff --git a/meson/pgsql/meson.build b/meson/pgsql/meson.build index c22e2c2ce6..b51a472a90 100644 --- a/meson/pgsql/meson.build +++ b/meson/pgsql/meson.build @@ -1,9 +1,6 @@ -# PostgreSQL -# Outputs: deps_pgsql +dep_pgsql = dependency('libpq', required: false) -deps_pgsql = dependency('libpq', required: false) - -if not deps_pgsql.found() +if not dep_pgsql.found() pg_config = find_program('pg_config', required: true) pg_cflags_res = run_command(pg_config, '--cflags', check: true) @@ -18,8 +15,15 @@ if not deps_pgsql.found() pg_version_res = run_command(pg_config, '--version', check: true) pg_version = pg_version_res.stdout().strip().split()[1] - deps_pgsql = declare_dependency(compile_args: pg_cflags + pg_cppflags, link_args: pg_ldflags, version: pg_version) + dep_pgsql = declare_dependency( + compile_args: pg_cflags + pg_cppflags, + link_args: pg_ldflags, + version: pg_version, + ) endif -summary('PostgreSQL', deps_pgsql.found(), bool_yn: true, section: 'Configuration') -summary('PostgreSQL Version', deps_pgsql.version(), section: 'Configuration') +summary('PostgreSQL', dep_pgsql.found(), bool_yn: true, section: 'PostgreSQL') + +if dep_pgsql.found() + summary('Version', dep_pgsql.version(), section: 'PostgreSQL') +endif