aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/__init__.py21
-rw-r--r--mesonbuild/modules/gnome.py20
-rw-r--r--mesonbuild/modules/rpm.py6
3 files changed, 27 insertions, 20 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py
index e69de29..493a7b9 100644
--- a/mesonbuild/modules/__init__.py
+++ b/mesonbuild/modules/__init__.py
@@ -0,0 +1,21 @@
+from .. import build
+
+class GResourceTarget(build.CustomTarget):
+ def __init__(self, name, subdir, kwargs):
+ super().__init__(name, subdir, kwargs)
+
+class GResourceHeaderTarget(build.CustomTarget):
+ def __init__(self, name, subdir, kwargs):
+ super().__init__(name, subdir, kwargs)
+
+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)
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)
diff --git a/mesonbuild/modules/rpm.py b/mesonbuild/modules/rpm.py
index dca1ad6..a0f79aa 100644
--- a/mesonbuild/modules/rpm.py
+++ b/mesonbuild/modules/rpm.py
@@ -19,7 +19,7 @@ from .. import build
from .. import compilers
import datetime
from .. import mlog
-from ..modules import gnome
+from . import GirTarget, TypelibTarget
import os
@@ -65,9 +65,9 @@ class RPMModule:
to_delete.add('%%{buildroot}%%{_libdir}/%s' % target.get_filename())
mlog.warning('removing', mlog.bold(target.get_filename()),
'from package because packaging static libs not recommended')
- elif isinstance(target, gnome.GirTarget) and target.should_install():
+ elif isinstance(target, GirTarget) and target.should_install():
files_devel.add('%%{_datadir}/gir-1.0/%s' % target.get_filename()[0])
- elif isinstance(target, gnome.TypelibTarget) and target.should_install():
+ elif isinstance(target, TypelibTarget) and target.should_install():
files.add('%%{_libdir}/girepository-1.0/%s' % target.get_filename()[0])
for header in state.headers:
if len(header.get_install_subdir()) > 0: