diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-14 22:13:38 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-15 04:12:23 +0530 |
commit | e6f48a03fc989119bb56ea5c7b748f99f0404b5b (patch) | |
tree | 513eeafe3c392ae4b01f7c844238b5f735b0e582 /mesonbuild/modules/gnome.py | |
parent | 330d9ba7fef6e3a9994eab66139af601741df379 (diff) | |
download | meson-e6f48a03fc989119bb56ea5c7b748f99f0404b5b.zip meson-e6f48a03fc989119bb56ea5c7b748f99f0404b5b.tar.gz meson-e6f48a03fc989119bb56ea5c7b748f99f0404b5b.tar.bz2 |
Allow all code to access module target classes
It is often useful to be able to check if a specific object is of a type
defined in a module. To that end, define all such targets in
modules/__init__.py so that everyone can refer to them without poking
into module-specific code.
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r-- | mesonbuild/modules/gnome.py | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index af3073f..6ddfb85 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -25,6 +25,7 @@ from .. import dependencies from .. import mlog from .. import mesonlib from .. import interpreter +from . import GResourceTarget, GResourceHeaderTarget, GirTarget, TypelibTarget, VapiTarget # gresource compilation is broken due to the way # the resource compiler and Ninja clash about it @@ -161,10 +162,7 @@ can not be used with the current version of glib-compiled-resources, due to depfile = kwargs['output'] + '.d' kwargs['depfile'] = depfile kwargs['command'] = copy.copy(cmd) + ['--dependency-file', '@DEPFILE@'] - target_c = build.CustomTarget(name, state.subdir, kwargs) - # Used in backend/ninjabackend.py:generate_vala_compile() to pass - # --gresources to valac when GResources are used in Vala targets - target_c.gresource_c_output = True + target_c = GResourceTarget(name, state.subdir, kwargs) if gresource: # Only one target for .gresource files return [target_c] @@ -180,7 +178,7 @@ can not be used with the current version of glib-compiled-resources, due to h_kwargs['install'] = install_header h_kwargs['install_dir'] = kwargs.get('install_dir', state.environment.coredata.get_builtin_option('includedir')) - target_h = build.CustomTarget(args[0] + '_h', state.subdir, h_kwargs) + target_h = GResourceHeaderTarget(args[0] + '_h', state.subdir, h_kwargs) return [target_c, target_h] def _get_gresource_dependencies(self, state, input_file, source_dirs, dependencies): @@ -1090,15 +1088,3 @@ can not be used with the current version of glib-compiled-resources, due to def initialize(): return GnomeModule() - -class GirTarget(build.CustomTarget): - def __init__(self, name, subdir, kwargs): - super().__init__(name, subdir, kwargs) - -class TypelibTarget(build.CustomTarget): - def __init__(self, name, subdir, kwargs): - super().__init__(name, subdir, kwargs) - -class VapiTarget(build.CustomTarget): - def __init__(self, name, subdir, kwargs): - super().__init__(name, subdir, kwargs) |