[PATCH xserver 7/7] meson: An empty array is not a dependency object
Eric Anholt
eric at anholt.net
Mon May 8 17:32:25 UTC 2017
Jon Turney <jon.turney at dronecode.org.uk> writes:
> Using the meson idiom of initializing a variaible to an empty array to
> represent a null value does not work well for a variable expected to hold a
> dependency object, as trying to apply found() to it will fail (currently).
>
> I think this can be demonstrated by configuing with Dglamor=no, then gbm_dep
> is set to [] in meson.build, and then tested with found() in
> include/meson.build.
>
> Use dependency('') to create an empty dependency.
>
> Future work: In the autotools build GBM is required if build_xorg &
> build_glamor. I suspect that it was also required for build_xwayland &
> build_glamor, but that was never checked. That test seems to have gone
> missing in meson.build, the required:false when checking for gbm should
> possibly be dropped?
>
> Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
> ---
> meson.build | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index d3e0685bd..bc2323641 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -177,7 +177,7 @@ endif
>
> build_dbus = build_hal or build_systemd_logind
>
> -udev_dep = []
> +udev_dep = dependency('', required:false)
> if build_udev
> udev_dep = dependency('libudev', version: '>= 143')
> endif
> @@ -198,7 +198,7 @@ else
> build_glamor = get_option('glamor') == 'yes'
> endif
Could we just do the gbm_dep hunk and not the udev one, if the udev hunk
isn't needed?
>
> -gbm_dep = []
> +gbm_dep = dependency('', required:false)
> if build_glamor
> gbm_dep = dependency('gbm', version: '>= 10.2', required: false)
> if gbm_dep.found()
We've certainly got a cleanup of gbm_dep to do, but I'm fine with this
for now. Meson folks agreed that this was the best workaround, though
"[].found() == false" may be available in the future.
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/20170508/4c22c7a1/attachment.sig>
More information about the xorg-devel
mailing list