aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorMartin Kelly <mkelly@xevo.com>2017-09-06 15:21:50 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2017-10-31 01:04:38 +0200
commit02bea7d5bf5c98c586e59e60357fc5ca11826172 (patch)
tree45657b5848ce1a30ff30451dc360e3ba3f39ee0a /mesonbuild/modules
parent68af8449d8576e27fb0390340f149f3001e8ea5f (diff)
downloadmeson-02bea7d5bf5c98c586e59e60357fc5ca11826172.zip
meson-02bea7d5bf5c98c586e59e60357fc5ca11826172.tar.gz
meson-02bea7d5bf5c98c586e59e60357fc5ca11826172.tar.bz2
namespace run_targets by subproject
Currently, run_target does not get namespaced for each subproject, unlike executable and others. This means that two subprojects sharing the same run_target name cause meson to crash. Fix this by moving the subproject namespacing logic from the BuildTarget class to the Target class.
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/__init__.py20
-rw-r--r--mesonbuild/modules/gnome.py26
-rw-r--r--mesonbuild/modules/i18n.py8
-rw-r--r--mesonbuild/modules/qt.py2
4 files changed, 28 insertions, 28 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py
index 364bc45..bf513fd 100644
--- a/mesonbuild/modules/__init__.py
+++ b/mesonbuild/modules/__init__.py
@@ -78,21 +78,21 @@ class ModuleReturnValue:
self.new_objects = new_objects
class GResourceTarget(build.CustomTarget):
- def __init__(self, name, subdir, kwargs):
- super().__init__(name, subdir, kwargs)
+ def __init__(self, name, subdir, subproject, kwargs):
+ super().__init__(name, subdir, subproject, kwargs)
class GResourceHeaderTarget(build.CustomTarget):
- def __init__(self, name, subdir, kwargs):
- super().__init__(name, subdir, kwargs)
+ def __init__(self, name, subdir, subproject, kwargs):
+ super().__init__(name, subdir, subproject, kwargs)
class GirTarget(build.CustomTarget):
- def __init__(self, name, subdir, kwargs):
- super().__init__(name, subdir, kwargs)
+ def __init__(self, name, subdir, subproject, kwargs):
+ super().__init__(name, subdir, subproject, kwargs)
class TypelibTarget(build.CustomTarget):
- def __init__(self, name, subdir, kwargs):
- super().__init__(name, subdir, kwargs)
+ def __init__(self, name, subdir, subproject, kwargs):
+ super().__init__(name, subdir, subproject, kwargs)
class VapiTarget(build.CustomTarget):
- def __init__(self, name, subdir, kwargs):
- super().__init__(name, subdir, kwargs)
+ def __init__(self, name, subdir, subproject, kwargs):
+ super().__init__(name, subdir, subproject, kwargs)
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 01604f2..4d20cc1 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -192,7 +192,7 @@ class GnomeModule(ExtensionModule):
depfile = kwargs['output'] + '.d'
kwargs['depfile'] = depfile
kwargs['command'] = copy.copy(cmd) + ['--dependency-file', '@DEPFILE@']
- target_c = GResourceTarget(name, state.subdir, kwargs)
+ target_c = GResourceTarget(name, state.subdir, state.subproject, kwargs)
if gresource: # Only one target for .gresource files
return ModuleReturnValue(target_c, [target_c])
@@ -210,7 +210,7 @@ class GnomeModule(ExtensionModule):
h_kwargs['install'] = install_header
h_kwargs['install_dir'] = kwargs.get('install_dir',
state.environment.coredata.get_builtin_option('includedir'))
- target_h = GResourceHeaderTarget(args[0] + '_h', state.subdir, h_kwargs)
+ target_h = GResourceHeaderTarget(args[0] + '_h', state.subdir, state.subproject, h_kwargs)
rv = [target_c, target_h]
return ModuleReturnValue(rv, rv)
@@ -612,7 +612,7 @@ class GnomeModule(ExtensionModule):
os.path.join(state.environment.get_datadir(), 'gir-1.0'))
if 'build_by_default' in kwargs:
scankwargs['build_by_default'] = kwargs['build_by_default']
- scan_target = GirTarget(girfile, state.subdir, scankwargs)
+ scan_target = GirTarget(girfile, state.subdir, state.subproject, scankwargs)
typelib_output = '%s-%s.typelib' % (ns, nsversion)
typelib_cmd = [gicompiler, scan_target, '--output', '@OUTPUT@']
@@ -630,7 +630,7 @@ class GnomeModule(ExtensionModule):
os.path.join(state.environment.get_libdir(), 'girepository-1.0'))
if 'build_by_default' in kwargs:
typelib_kwargs['build_by_default'] = kwargs['build_by_default']
- typelib_target = TypelibTarget(typelib_output, state.subdir, typelib_kwargs)
+ typelib_target = TypelibTarget(typelib_output, state.subdir, state.subproject, typelib_kwargs)
rv = [scan_target, typelib_target]
return ModuleReturnValue(rv, rv)
@@ -650,7 +650,7 @@ class GnomeModule(ExtensionModule):
targetname = 'gsettings-compile'
else:
targetname = 'gsettings-compile-' + state.subdir.replace('/', '_')
- target_g = build.CustomTarget(targetname, state.subdir, kwargs)
+ target_g = build.CustomTarget(targetname, state.subdir, state.subproject, kwargs)
return ModuleReturnValue(target_g, [target_g])
@permittedKwargs({'sources', 'media', 'symlink_media', 'languages'})
@@ -705,7 +705,7 @@ This will become a hard error in the future.''')
'--sources=' + source_str,
]
pottarget = build.RunTarget('help-' + project_id + '-pot', potargs[0],
- potargs[1:], [], state.subdir)
+ potargs[1:], [], state.subdir, state.subproject)
poargs = state.environment.get_build_command() + [
'--internal', 'yelphelper', 'update-po',
@@ -715,7 +715,7 @@ This will become a hard error in the future.''')
'--langs=' + '@@'.join(langs),
]
potarget = build.RunTarget('help-' + project_id + '-update-po', poargs[0],
- poargs[1:], [], state.subdir)
+ poargs[1:], [], state.subdir, state.subproject)
rv = [inscript, pottarget, potarget]
return ModuleReturnValue(None, rv)
@@ -788,7 +788,7 @@ This will become a hard error in the future.''')
args += self._unpack_args('--ignore-headers=', 'ignore_headers', kwargs)
args += self._unpack_args('--installdir=', 'install_dir', kwargs, state)
args += self._get_build_args(kwargs, state)
- res = [build.RunTarget(targetname, command[0], command[1:] + args, [], state.subdir)]
+ res = [build.RunTarget(targetname, command[0], command[1:] + args, [], state.subdir, state.subproject)]
if kwargs.get('install', True):
res.append(build.RunScript(command, args))
return ModuleReturnValue(None, res)
@@ -885,7 +885,7 @@ This will become a hard error in the future.''')
}
if 'build_by_default' in kwargs:
custom_kwargs['build_by_default'] = kwargs['build_by_default']
- ct = build.CustomTarget(target_name, state.subdir, custom_kwargs)
+ ct = build.CustomTarget(target_name, state.subdir, state.subproject, custom_kwargs)
return ModuleReturnValue(ct, [ct])
@permittedKwargs({'sources', 'c_template', 'h_template', 'install_header', 'install_dir',
@@ -1101,7 +1101,7 @@ G_END_DECLS'''
'command': cmd
}
custom_kwargs.update(kwargs)
- return build.CustomTarget(output, state.subdir, custom_kwargs,
+ return build.CustomTarget(output, state.subdir, state.subproject, custom_kwargs,
# https://github.com/mesonbuild/meson/issues/973
absolute_paths=True)
@@ -1171,7 +1171,7 @@ G_END_DECLS'''
# Silence any warnings about missing prototypes
custom_kwargs['command'] += ['--include-header', header_file]
custom_kwargs['output'] = output + '.c'
- body = build.CustomTarget(output + '_c', state.subdir, custom_kwargs)
+ body = build.CustomTarget(output + '_c', state.subdir, state.subproject, custom_kwargs)
custom_kwargs['install'] = install_header
if install_dir is not None:
@@ -1180,7 +1180,7 @@ G_END_DECLS'''
cmd += ['--pragma-once']
custom_kwargs['command'] = cmd + ['--header', '@INPUT@']
custom_kwargs['output'] = header_file
- header = build.CustomTarget(output + '_h', state.subdir, custom_kwargs)
+ header = build.CustomTarget(output + '_h', state.subdir, state.subproject, custom_kwargs)
rv = [body, header]
return ModuleReturnValue(rv, rv)
@@ -1316,7 +1316,7 @@ G_END_DECLS'''
# We shouldn't need this locally but we install it
deps_target = self._generate_deps(state, library, vapi_packages, install_dir)
created_values.append(deps_target)
- vapi_target = VapiTarget(vapi_output, state.subdir, custom_kwargs)
+ vapi_target = VapiTarget(vapi_output, state.subdir, state.subproject, custom_kwargs)
# So to try our best to get this to just work we need:
# - link with with the correct library
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index c1dd837..6c02fbb 100644
--- a/mesonbuild/modules/i18n.py
+++ b/mesonbuild/modules/i18n.py
@@ -79,7 +79,7 @@ class I18nModule(ExtensionModule):
command.append(datadirs)
kwargs['command'] = command
- ct = build.CustomTarget(kwargs['output'] + '_merge', state.subdir, kwargs)
+ ct = build.CustomTarget(kwargs['output'] + '_merge', state.subdir, state.subproject, kwargs)
return ModuleReturnValue(ct, [ct])
@permittedKwargs({'po_dir', 'data_dirs', 'type', 'languages', 'args', 'preset', 'install'})
@@ -111,12 +111,12 @@ class I18nModule(ExtensionModule):
potargs.append(datadirs)
if extra_args:
potargs.append(extra_args)
- pottarget = build.RunTarget(packagename + '-pot', potargs[0], potargs[1:], [], state.subdir)
+ pottarget = build.RunTarget(packagename + '-pot', potargs[0], potargs[1:], [], state.subdir, state.subproject)
gmoargs = state.environment.get_build_command() + ['--internal', 'gettext', 'gen_gmo']
if lang_arg:
gmoargs.append(lang_arg)
- gmotarget = build.RunTarget(packagename + '-gmo', gmoargs[0], gmoargs[1:], [], state.subdir)
+ gmotarget = build.RunTarget(packagename + '-gmo', gmoargs[0], gmoargs[1:], [], state.subdir, state.subproject)
updatepoargs = state.environment.get_build_command() + ['--internal', 'gettext', 'update_po', pkg_arg]
if lang_arg:
@@ -125,7 +125,7 @@ class I18nModule(ExtensionModule):
updatepoargs.append(datadirs)
if extra_args:
updatepoargs.append(extra_args)
- updatepotarget = build.RunTarget(packagename + '-update-po', updatepoargs[0], updatepoargs[1:], [], state.subdir)
+ updatepotarget = build.RunTarget(packagename + '-update-po', updatepoargs[0], updatepoargs[1:], [], state.subdir, state.subproject)
targets = [pottarget, gmotarget, updatepotarget]
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 0b7354f..5800e5c 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -110,7 +110,7 @@ class QtBaseModule:
'output': name + '.cpp',
'command': [self.rcc, '-o', '@OUTPUT@', '@INPUT@'],
'depend_files': qrc_deps}
- res_target = build.CustomTarget(name, state.subdir, rcc_kwargs)
+ res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs)
sources.append(res_target)
if len(ui_files) > 0:
if not self.uic.found():