diff options
author | Dylan Baker <[email protected]> | 2018-03-15 13:30:22 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-04-06 15:29:53 -0700 |
commit | b5f92b6fd4e4ef0358fe464d951893de20048bf6 (patch) | |
tree | b701b8208feac6431e752911020a6e2c93eeb656 /src | |
parent | 81ed629b385af62bbac2d7975986ea7ad4ed2d1a (diff) |
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 <[email protected]>
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/meson.build | 2 | ||||
-rw-r--r-- | src/glx/apple/meson.build | 2 | ||||
-rw-r--r-- | src/glx/meson.build | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/meson.build b/src/gallium/auxiliary/meson.build index 5908f9c4309..0108b0e7567 100644 --- a/src/gallium/auxiliary/meson.build +++ b/src/gallium/auxiliary/meson.build @@ -339,7 +339,7 @@ files_libgallium = files( 'nir/tgsi_to_nir.h', ) -if dep_libdrm != [] and dep_libdrm.found() +if dep_libdrm.found() files_libgallium += files( 'renderonly/renderonly.c', 'renderonly/renderonly.h', 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 diff --git a/src/glx/meson.build b/src/glx/meson.build index 7ac46ac0662..90ab552ac4d 100644 --- a/src/glx/meson.build +++ b/src/glx/meson.build @@ -137,7 +137,7 @@ gl_lib_cargs = [ '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path), ] -if dep_xxf86vm != [] and dep_xxf86vm.found() +if dep_xxf86vm.found() gl_lib_cargs += '-DHAVE_XF86VIDMODE' endif |