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.
pull/7155/head
Nirbheek Chauhan 5 years ago committed by Nirbheek Chauhan
parent a25f0741e8
commit b1e3440e59
  1. 2
      mesonbuild/backend/ninjabackend.py
  2. 11
      mesonbuild/modules/__init__.py

@ -570,7 +570,7 @@ int dummy;
generated_source_files.append(raw_src) generated_source_files.append(raw_src)
elif self.environment.is_object(rel_src): elif self.environment.is_object(rel_src):
obj_list.append(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 pass
else: else:
# Assume anything not specifically a source file is a header. This is because # Assume anything not specifically a source file is a header. This is because

@ -57,6 +57,17 @@ def get_include_args(include_dirs, prefix='-I'):
return dirs_str 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: class ModuleReturnValue:
def __init__(self, return_value, new_objects): def __init__(self, return_value, new_objects):
self.return_value = return_value self.return_value = return_value

Loading…
Cancel
Save