Made gtkdoc and run targets work.

pull/356/head
Jussi Pakkanen 9 years ago
parent 23b98cd6e6
commit d6e176f455
  1. 2
      mesonbuild/mesonmain.py
  2. 8
      mesonbuild/modules/gnome.py
  3. 4
      mesonbuild/ninjabackend.py
  4. 14
      mesonbuild/scripts/commandrunner.py

@ -188,7 +188,7 @@ def run_script_command(args):
import mesonbuild.scripts.dirchanger as abc
cmdfunc = abc.run
elif cmdname == 'gtkdoc':
import meson.scripts.gtkdochelper as abc
import mesonbuild.scripts.gtkdochelper as abc
cmdfunc = abc.run
elif cmdname == 'regencheck':
import mesonbuild.scripts.regen_checker as abc

@ -260,11 +260,11 @@ class GnomeModule:
main_file = main_xml
src_dir = kwargs['src_dir']
targetname = modulename + '-doc'
command = os.path.normpath(os.path.join(os.path.split(__file__)[0], "../gtkdochelper.py"))
command = [state.environment.get_build_command(), '--internal', 'gtkdoc']
if hasattr(src_dir, 'held_object'):
src_dir= src_dir.held_object
if not isinstance(src_dir, build.IncludeDirs):
raise MesonException('Invalidt keyword argument for src_dir.')
raise MesonException('Invalid keyword argument for src_dir.')
incdirs = src_dir.get_incdirs()
if len(incdirs) != 1:
raise MesonException('Argument src_dir has more than one directory specified.')
@ -279,9 +279,9 @@ class GnomeModule:
'--modulename=' + modulename]
args += self.unpack_args('--htmlargs=', 'html_args', kwargs)
args += self.unpack_args('--scanargs=', 'scan_args', kwargs)
res = [build.RunTarget(targetname, command, args, state.subdir)]
res = [build.RunTarget(targetname, command[0], command[1:] + args, state.subdir)]
if kwargs.get('install', True):
res.append(build.InstallScript([command] + args))
res.append(build.InstallScript(command + args))
return res
def unpack_args(self, arg, kwarg_name, kwargs):

@ -362,7 +362,7 @@ int dummy;
self.processed_targets[target.name + target.type_suffix()] = True
def generate_run_target(self, target, outfile):
runnerscript = os.path.join(self.environment.get_script_dir(), 'commandrunner.py')
runnerscript = [sys.executable, self.environment.get_build_command(), '--internal', 'commandrunner']
deps = []
arg_strings = []
for i in target.args:
@ -376,7 +376,7 @@ int dummy;
mlog.debug(str(i))
raise MesonException('Unreachable code in generate_run_target.')
elem = NinjaBuildElement(target.name, 'CUSTOM_COMMAND', deps)
cmd = [sys.executable, runnerscript, self.environment.get_source_dir(), self.environment.get_build_dir(), target.subdir]
cmd = runnerscript + [self.environment.get_source_dir(), self.environment.get_build_dir(), target.subdir]
texe = target.command
try:
texe = texe.held_object

@ -43,14 +43,14 @@ def run_command(source_dir, build_dir, subdir, command, arguments):
sys.exit(1)
def run(args):
if len(sys.argv) < 4:
if len(args) < 4:
print('commandrunner.py <source dir> <build dir> <subdir> <command> [arguments]')
sys.exit(1)
src_dir = sys.argv[1]
build_dir = sys.argv[2]
subdir = sys.argv[3]
command = sys.argv[4]
arguments = sys.argv[5:]
return 1
src_dir = args[0]
build_dir = args[1]
subdir = args[2]
command = args[3]
arguments = args[4:]
pc = run_command(src_dir, build_dir, subdir, command, arguments)
pc.wait()
return pc.returncode

Loading…
Cancel
Save