meson: multiple names can be passed to dependency()
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 27 Mar 2022 14:05:58 +0000 (16:05 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 1 Oct 2022 19:16:36 +0000 (21:16 +0200)
This is new in Meson 0.60.0.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
meson.build

index 077441fe882d246c672d53c722f9cf155555239e..780654b00c788689dfa587ba9da4e00b08abc576 100644 (file)
@@ -830,14 +830,10 @@ if have_system and get_option('curses').allowed()
     }'''
 
   curses_dep_list = targetos == 'windows' ? ['ncurses', 'ncursesw'] : ['ncursesw']
-  foreach curses_dep : curses_dep_list
-    if not curses.found()
-      curses = dependency(curses_dep,
-                          required: false,
-                          method: 'pkg-config',
-                          kwargs: static_kwargs)
-    endif
-  endforeach
+  curses = dependency(curses_dep_list,
+                      required: false,
+                      method: 'pkg-config',
+                      kwargs: static_kwargs)
   msg = get_option('curses').enabled() ? 'curses library not found' : ''
   curses_compile_args = ['-DNCURSES_WIDECHAR=1']
   if curses.found()