[PATCH xserver 2/2] meson: Use dependency version_compare()

Eric Anholt eric at anholt.net
Wed Sep 20 18:05:12 UTC 2017


Daniel Stone <daniels at collabora.com> writes:

> We can check the version on an existing dependency, rather than spinning
> up pkg-config again just to check the right version.
>
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  include/meson.build | 7 +++----
>  meson.build         | 3 ---
>  2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/include/meson.build b/include/meson.build
> index 05ef76930..5eefc5f07 100644
> --- a/include/meson.build
> +++ b/include/meson.build
> @@ -72,13 +72,12 @@ conf_data.set_quoted('SHMDIR', '/tmp')
>  conf_data.set('HAVE_XSHMFENCE', xshmfence_dep.found())
>  conf_data.set('WITH_LIBDRM', libdrm_dep.found())
>  conf_data.set('GLAMOR_HAS_DRM_NAME_FROM_FD_2',
> -              dependency('libdrm', version: '>= 2.4.74', required: false).found())
> +              libdrm_dep.found() and libdrm_dep.version().version_compare('>= 2.4.74'))

nirbheek says there's a meson patch to be merged soon that handles the
caching of pkg-config outputs automatically so you don't need to do this
dep.found() and dep.version().version_compare() dance.  That said,
you've reduced the build system complexity with the rest of this patch,
so:

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20170920/7f382e27/attachment.sig>


More information about the xorg-devel mailing list