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/glx/apple/meson.build | |
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/glx/apple/meson.build')
-rw-r--r-- | src/glx/apple/meson.build | 2 |
1 files changed, 1 insertions, 1 deletions
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 |