From b5f92b6fd4e4ef0358fe464d951893de20048bf6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 15 Mar 2018 13:30:22 -0700 Subject: meson: fix warnings about comparing unlike types In the old days (0.42.x), when mesa's meson system was written the recommendation for handling conditional dependencies was to define them as empty lists. When meson would evaluate the dependencies of a target it would recursively flatten all of the arguments, and empty lists would be removed. There are some problems with this, among them that lists and dependencies have different methods (namely .found()), so the recommendation changed to use `dependency('', required : false)` for such cases. This has the advantage of providing a .found() method, so there is no need to do things like `dep_foo != [] and dep_foo.found()`, such a dependency should never exist. I've tested this with 0.42 (the minimum we claim to support) and 0.45. On 0.45 this removes warnings about comparing unlike types, such as: meson.build:1337: WARNING: Trying to compare values of different types (DependencyHolder, list) using !=. v2: - Use dependency('', required : false) instead of declare_dependency(), the later will always report that it is found, which is not what we want. Signed-off-by: Dylan Baker Reviewed-by: Caio Marcelo de Oliveira Filho --- src/glx/apple/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glx/apple') diff --git a/src/glx/apple/meson.build b/src/glx/apple/meson.build index 2d1014da0f8..c6b1d617c4f 100644 --- a/src/glx/apple/meson.build +++ b/src/glx/apple/meson.build @@ -46,7 +46,7 @@ files_libappleglx = files( 'glx_empty.c', ) -dep_xplugin = [] +dep_xplugin = null_dep if with_dri_platform == 'apple' dep_xplugin = meson.get_compiler('c').find_library('Xplugin') endif -- cgit v1.2.3