From 3a2e333f004828e5390ce96344cb338be11e70b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 28 May 2017 10:47:50 +0200 Subject: gnome: Use --pkg to pass pkg-config cflags to g-ir-scanner While g-ir-scanner's compatible -I and -D flags cover what most pkg-config files use, there's no guarantee that files don't set anything more exotic that conflicts with the tool's own options. For a real world example, mozjs-38 has '-include some-header-file.h', which translates to '--include nclude another-file-to-scan.h' for the scanner; unless for some reason there's an 'nclude' GIR available on the system, the target will thus fail. Avoid this case by pointing g-ir-scanner to the correct pkg-config file instead of passing any cflags directly. --- mesonbuild/modules/gnome.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mesonbuild/modules/gnome.py') diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index b8092b2..0c4b67a 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -332,7 +332,10 @@ class GnomeModule(ExtensionModule): source.held_object.get_subdir())]) # This should be any dependency other than an internal one. elif isinstance(dep, Dependency): - cflags.update(dep.get_compile_args()) + if isinstance(dep, PkgConfigDependency) and use_gir_args: + cflags.update(["--pkg=%s" % dep.get_name()]) + else: + cflags.update(dep.get_compile_args()) for lib in dep.get_link_args(): if (os.path.isabs(lib) and # For PkgConfigDependency only: -- cgit v1.1