From ce3cec40da8a9b3b4454ab396db5d6b90adf7703 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Sat, 10 Jun 2017 20:33:33 +0200 Subject: [PATCH 1/2] Skip handling non-available dependencies This way, an optional dependency can always be added on Vala targets without meson adding --pkg --- mesonbuild/backend/backends.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 1dd128b48..95b0026af 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -429,6 +429,9 @@ class Backend: # NOTE: We must preserve the order in which external deps are # specified, so we reverse the list before iterating over it. for dep in reversed(target.get_external_deps()): + if not dep.found(): + continue + if compiler.language == 'vala': if isinstance(dep, dependencies.PkgConfigDependency): if dep.name == 'glib-2.0' and dep.version_reqs is not None: From 03ba7cd8433975a4c6bce56aba754825bd61627f Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 4 Jun 2017 23:43:58 +0530 Subject: [PATCH 2/2] Add a test for ignoring not-found vala deps https://github.com/mesonbuild/meson/pull/1986 --- test cases/vala/3 dep/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test cases/vala/3 dep/meson.build b/test cases/vala/3 dep/meson.build index d327fb519..c3563b1e6 100644 --- a/test cases/vala/3 dep/meson.build +++ b/test cases/vala/3 dep/meson.build @@ -2,7 +2,10 @@ project('giotest', 'vala', 'c') glib = dependency('glib-2.0') gobject = dependency('gobject-2.0') -gio = dependency('gio-2.0') +gio = [dependency('gio-2.0'), + # https://github.com/mesonbuild/meson/issues/1484 + dependency('gio-unix-2.0', required : false), + dependency('gio-windows-2.0', required : false)] e = executable('gioprog', 'gioprog.vala', dependencies : [glib, gobject, gio])