meson: use a single dependency call for lua
authorDylan Baker <dylan.c.baker@intel.com>
Fri, 15 Sep 2023 17:24:43 +0000 (10:24 -0700)
committerMarge Bot <emma+marge@anholt.net>
Fri, 15 Sep 2023 18:01:38 +0000 (18:01 +0000)
This is a newer Meson construct that allows passing multiple names for
the same dependency to one call. One advantage of this is that if the
first call (lua54) fails, it won't immediately fall back to a subproject
and will try the others before falling back.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25251>

src/freedreno/meson.build

index 574110b..a5cdefb 100644 (file)
@@ -25,13 +25,8 @@ rnn_src_path = dir_source_root + '/src/freedreno/registers'
 rnn_install_path = get_option('datadir') + '/freedreno/registers'
 rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path
 
-# TODO: use multi-argument dependency() in meson 0.60
-foreach lua : ['lua54', 'lua53', 'lua52', 'lua']
-    dep_lua = dependency(lua, required: false, fallback : ['lua', 'lua_dep'], version: '>=5.2')
-    if dep_lua.found()
-        break
-    endif
-endforeach
+dep_lua = dependency('lua54', 'lua53', 'lua52', 'lua', required: false,
+                     fallback : ['lua', 'lua_dep'], version: '>=5.2')
 
 dep_libarchive = dependency('libarchive', fallback : ['libarchive', 'libarchive_dep'], required: false)
 dep_libxml2 = dependency('libxml-2.0', fallback: ['libxml2', 'libxml2_dep'], required: false)