diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-05-13 16:56:09 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-05-15 08:39:25 +0000 |
commit | b1e3440e596b632e09c48ef88ada6a5224628720 (patch) | |
tree | cde98632a7a1ca1cbb444d928b756352d2d8bb8a | |
parent | a25f0741e8ac663c8b3a6e33df8a0875dceab804 (diff) | |
download | meson-b1e3440e596b632e09c48ef88ada6a5224628720.zip meson-b1e3440e596b632e09c48ef88ada6a5224628720.tar.gz meson-b1e3440e596b632e09c48ef88ada6a5224628720.tar.bz2 |
ninjabackend: Treat GNOME gir/typelib as libraries
When classifying generated sources, we were treating gir/typelib files
generated by gobject-introspection as headers. This is bad because it
serializes the build by adding order-only dependencies to every target
even though sources will never actually use them for anything.
Treat them as libraries, which is somewhat more accurate.
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/__init__.py | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index b1e6afa..2aa5c2c 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -570,7 +570,7 @@ int dummy; generated_source_files.append(raw_src) elif self.environment.is_object(rel_src): obj_list.append(rel_src) - elif self.environment.is_library(rel_src): + elif self.environment.is_library(rel_src) or modules.is_module_library(rel_src): pass else: # Assume anything not specifically a source file is a header. This is because diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index dc86a1b..47be039 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -57,6 +57,17 @@ def get_include_args(include_dirs, prefix='-I'): return dirs_str +def is_module_library(fname): + ''' + Check if the file is a library-like file generated by a module-specific + target, such as GirTarget or TypelibTarget + ''' + if hasattr(fname, 'fname'): + fname = fname.fname + suffix = fname.split('.')[-1] + return suffix in ('gir', 'typelib') + + class ModuleReturnValue: def __init__(self, return_value, new_objects): self.return_value = return_value |