aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Users.md3
-rw-r--r--mesonbuild/modules/pkgconfig.py5
-rwxr-xr-xrun_unittests.py9
-rw-r--r--test cases/unit/21 warning location/a.c (renamed from test cases/unit/20 warning location/a.c)0
-rw-r--r--test cases/unit/21 warning location/b.c (renamed from test cases/unit/20 warning location/b.c)0
-rw-r--r--test cases/unit/21 warning location/conf.in (renamed from test cases/unit/20 warning location/conf.in)0
-rw-r--r--test cases/unit/21 warning location/main.c (renamed from test cases/unit/20 warning location/main.c)0
-rw-r--r--test cases/unit/21 warning location/meson.build (renamed from test cases/unit/20 warning location/meson.build)0
-rw-r--r--test cases/unit/21 warning location/sub/c.c (renamed from test cases/unit/20 warning location/sub/c.c)0
-rw-r--r--test cases/unit/21 warning location/sub/d.c (renamed from test cases/unit/20 warning location/sub/d.c)0
-rw-r--r--test cases/unit/21 warning location/sub/meson.build (renamed from test cases/unit/20 warning location/sub/meson.build)0
-rw-r--r--test cases/unit/21 warning location/sub/sub.c (renamed from test cases/unit/20 warning location/sub/sub.c)0
-rw-r--r--test cases/unit/22 unfound pkgconfig/meson.build15
-rw-r--r--test cases/unit/22 unfound pkgconfig/some.c3
14 files changed, 33 insertions, 2 deletions
diff --git a/docs/markdown/Users.md b/docs/markdown/Users.md
index 616fdc5..78ad1b7 100644
--- a/docs/markdown/Users.md
+++ b/docs/markdown/Users.md
@@ -25,13 +25,16 @@ If you have a project that uses Meson that you want to add to this list, let us
- [GTK+](https://git.gnome.org/browse/gtk+/), the multi-platform toolkit used by GNOME
- [GtkDApp](https://gitlab.com/csoriano/GtkDApp), an application template for developing Flatpak apps with Gtk+ and D
- [HexChat](https://github.com/hexchat/hexchat), a cross-platform IRC client in C
+ - [IGT](https://cgit.freedesktop.org/xorg/app/intel-gpu-tools/), Linux kernel graphics driver test suite.
- [Json-glib](https://git.gnome.org/browse/json-glib), GLib-based JSON manipulation library
- [Ksh](https://github.com/att/ast), a Korn Shell
+ - [Libdrm](https://cgit.freedesktop.org/drm/libdrm/), a library for abstracting DRM kernel interfaces
- [Libepoxy](https://github.com/anholt/libepoxy/), a library for handling OpenGL function pointer management
- [Libgit2-glib](https://git.gnome.org/browse/libgit2-glib/), a GLib wrapper for libgit2
- [Libhttpseverywhere](https://github.com/grindhold/libhttpseverywhere), a library to enable httpseverywhere on any desktop app
- [Lightdm-Webkit2-Greeter](https://github.com/Antergos/lightdm-webkit2-greeter)
- [Kiwix libraries](https://github.com/kiwix/kiwix-lib)
+ - [Mesa](https://www.mesa3d.org/), An open source graphics driver project
- [Nautilus](https://git.gnome.org/browse/nautilus/commit/?id=ed5652c89ac0654df2e82b54b00b27d51c825465) the Gnome file manager
- [Orc](http://cgit.freedesktop.org/gstreamer/orc/), the Optimized Inner Loop Runtime Compiler (not the default yet)
- [Pango](https://git.gnome.org/browse/pango/), an Internationalized text layout and rendering library (not the default yet)
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 54c2126..c951920 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -79,7 +79,7 @@ class DependenciesHelper:
if not hasattr(obj, 'generated_pc'):
obj.generated_pc = self.name
self.add_priv_libs(obj.get_dependencies())
- self.add_priv_libs(obj.get_external_deps())
+ self.add_priv_libs(self.strip_unfound(obj.get_external_deps()))
elif isinstance(obj, str):
processed_libs.append(obj)
else:
@@ -87,6 +87,9 @@ class DependenciesHelper:
return processed_libs, processed_reqs, processed_cflags
+ def strip_unfound(self, deps):
+ return [x for x in deps if not hasattr(x, 'found') or x.found()]
+
def remove_dups(self):
self.pub_libs = list(set(self.pub_libs))
self.pub_reqs = list(set(self.pub_reqs))
diff --git a/run_unittests.py b/run_unittests.py
index f61544f..eef4fe8 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -436,6 +436,7 @@ class BasePlatformTests(unittest.TestCase):
# In case the directory is inside a symlinked directory, find the real
# path otherwise we might not find the srcdir from inside the builddir.
self.builddir = os.path.realpath(tempfile.mkdtemp())
+ self.privatedir = os.path.join(self.builddir, 'meson-private')
self.logdir = os.path.join(self.builddir, 'meson-logs')
self.prefix = '/usr'
self.libdir = os.path.join(self.prefix, 'lib')
@@ -1702,7 +1703,7 @@ int main(int argc, char **argv) {
self.build()
def test_warning_location(self):
- tdir = os.path.join(self.unit_test_dir, '20 warning location')
+ tdir = os.path.join(self.unit_test_dir, '21 warning location')
out = self.init(tdir)
for expected in [
r'WARNING: Keyword argument "link_with" defined multiple times in file meson.build, line 4',
@@ -2085,6 +2086,12 @@ class LinuxlikeTests(BasePlatformTests):
'-llibinternal', '-lcustom2',
'-lfoo']))
+ def test_pkg_unfound(self):
+ testdir = os.path.join(self.unit_test_dir, '22 unfound pkgconfig')
+ self.init(testdir)
+ pcfile = open(os.path.join(self.privatedir, 'somename.pc')).read()
+ self.assertFalse('blub_blob_blib' in pcfile)
+
def test_vala_c_warnings(self):
'''
Test that no warnings are emitted for C code generated by Vala. This
diff --git a/test cases/unit/20 warning location/a.c b/test cases/unit/21 warning location/a.c
index e69de29..e69de29 100644
--- a/test cases/unit/20 warning location/a.c
+++ b/test cases/unit/21 warning location/a.c
diff --git a/test cases/unit/20 warning location/b.c b/test cases/unit/21 warning location/b.c
index e69de29..e69de29 100644
--- a/test cases/unit/20 warning location/b.c
+++ b/test cases/unit/21 warning location/b.c
diff --git a/test cases/unit/20 warning location/conf.in b/test cases/unit/21 warning location/conf.in
index a2903ed..a2903ed 100644
--- a/test cases/unit/20 warning location/conf.in
+++ b/test cases/unit/21 warning location/conf.in
diff --git a/test cases/unit/20 warning location/main.c b/test cases/unit/21 warning location/main.c
index e69de29..e69de29 100644
--- a/test cases/unit/20 warning location/main.c
+++ b/test cases/unit/21 warning location/main.c
diff --git a/test cases/unit/20 warning location/meson.build b/test cases/unit/21 warning location/meson.build
index 15295a9..15295a9 100644
--- a/test cases/unit/20 warning location/meson.build
+++ b/test cases/unit/21 warning location/meson.build
diff --git a/test cases/unit/20 warning location/sub/c.c b/test cases/unit/21 warning location/sub/c.c
index e69de29..e69de29 100644
--- a/test cases/unit/20 warning location/sub/c.c
+++ b/test cases/unit/21 warning location/sub/c.c
diff --git a/test cases/unit/20 warning location/sub/d.c b/test cases/unit/21 warning location/sub/d.c
index e69de29..e69de29 100644
--- a/test cases/unit/20 warning location/sub/d.c
+++ b/test cases/unit/21 warning location/sub/d.c
diff --git a/test cases/unit/20 warning location/sub/meson.build b/test cases/unit/21 warning location/sub/meson.build
index 27f6778..27f6778 100644
--- a/test cases/unit/20 warning location/sub/meson.build
+++ b/test cases/unit/21 warning location/sub/meson.build
diff --git a/test cases/unit/20 warning location/sub/sub.c b/test cases/unit/21 warning location/sub/sub.c
index e69de29..e69de29 100644
--- a/test cases/unit/20 warning location/sub/sub.c
+++ b/test cases/unit/21 warning location/sub/sub.c
diff --git a/test cases/unit/22 unfound pkgconfig/meson.build b/test cases/unit/22 unfound pkgconfig/meson.build
new file mode 100644
index 0000000..1285c0a
--- /dev/null
+++ b/test cases/unit/22 unfound pkgconfig/meson.build
@@ -0,0 +1,15 @@
+project('foobar', 'c')
+
+unfound = dependency('blub_blob_blib', required : false)
+
+pkgg = import('pkgconfig')
+
+l = shared_library('somename', 'some.c',
+ dependencies : unfound)
+
+pkgg.generate(
+ libraries : l,
+ name : 'somename',
+ version : '1.0.0',
+ description : 'A test library.',
+)
diff --git a/test cases/unit/22 unfound pkgconfig/some.c b/test cases/unit/22 unfound pkgconfig/some.c
new file mode 100644
index 0000000..fb765fb
--- /dev/null
+++ b/test cases/unit/22 unfound pkgconfig/some.c
@@ -0,0 +1,3 @@
+int some() {
+ return 6;
+}