From 73c06780f93f7565a39def7ed08e404fbcaae358 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 17 Jun 2017 15:04:26 +0530 Subject: Make external library no-op when used with incompatible target (#1941) * tests: Add a test for C library in Vala target https://github.com/mesonbuild/meson/issues/1939 * Make external library no-op when used with incompatible target This is how it used to behave earlier, but we accidentally regressed Closes https://github.com/mesonbuild/meson/issues/1939 --- mesonbuild/dependencies/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 14ec41e..fdb5ab8 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -528,7 +528,10 @@ class ExternalLibrary(ExternalDependency): C-like code. Note that C++ libraries *can* be linked with C code with a C++ linker (and vice-versa). ''' - if self.language == 'vala' and language != 'vala': + # Using a vala library in a non-vala target, or a non-vala library in a vala target + # XXX: This should be extended to other non-C linkers such as Rust + if (self.language == 'vala' and language != 'vala') or \ + (language == 'vala' and self.language != 'vala'): return [] return self.link_args -- cgit v1.1