Finally full test suite passes, even gir.

pull/255/head
Jussi Pakkanen 10 years ago
parent 0131555e28
commit a90bbb7277
  1. 7
      interpreter.py
  2. 6
      modules/gnome.py
  3. 15
      ninjabackend.py
  4. 4
      test cases/frameworks/7 gnome/gir/meson.build

@ -453,7 +453,9 @@ class BuildTargetHolder(InterpreterObject):
super().__init__() super().__init__()
self.held_object = target self.held_object = target
self.methods.update({'extract_objects' : self.extract_objects_method, self.methods.update({'extract_objects' : self.extract_objects_method,
'extract_all_objects' : self.extract_all_objects_method}) 'extract_all_objects' : self.extract_all_objects_method,
'get_id': self.get_id_method,
})
def is_cross(self): def is_cross(self):
return self.held_object.is_cross() return self.held_object.is_cross()
@ -466,6 +468,9 @@ class BuildTargetHolder(InterpreterObject):
gobjs = self.held_object.extract_all_objects() gobjs = self.held_object.extract_all_objects()
return GeneratedObjectsHolder(gobjs) return GeneratedObjectsHolder(gobjs)
def get_id_method(self, args, kwargs):
return self.held_object.get_id()
class ExecutableHolder(BuildTargetHolder): class ExecutableHolder(BuildTargetHolder):
def __init__(self, target): def __init__(self, target):
super().__init__(target) super().__init__(target)

@ -147,7 +147,7 @@ class GnomeModule:
if isinstance(girtarget, build.Executable): if isinstance(girtarget, build.Executable):
scan_command += ['--program', girtarget] scan_command += ['--program', girtarget]
elif isinstance(girtarget, build.SharedLibrary): elif isinstance(girtarget, build.SharedLibrary):
scan_command += ["-L", os.path.join (state.environment.get_build_dir(), girtarget.subdir)] scan_command += ["-L@PRIVATE_OUTDIR_ABS_%s@" % girtarget.get_id()]
libname = girtarget.get_basename() libname = girtarget.get_basename()
scan_command += ['--library', libname] scan_command += ['--library', libname]
scankwargs = {'output' : girfile, scankwargs = {'output' : girfile,
@ -163,9 +163,9 @@ class GnomeModule:
typelib_output = '%s-%s.typelib' % (ns, nsversion) typelib_output = '%s-%s.typelib' % (ns, nsversion)
typelib_cmd = ['g-ir-compiler', scan_target, '--output', '@OUTPUT@'] typelib_cmd = ['g-ir-compiler', scan_target, '--output', '@OUTPUT@']
if inc_dirs: if inc_dirs:
for id in inc_dirs: for incd in inc_dirs:
typelib_cmd += ['--includedir=%s' % inc for inc in typelib_cmd += ['--includedir=%s' % inc for inc in
id.held_object.get_incdirs()] incd.held_object.get_incdirs()]
if deps: if deps:
for dep in deps: for dep in deps:
girdir = dep.held_object.get_variable ("girdir") girdir = dep.held_object.get_variable ("girdir")

@ -306,9 +306,20 @@ class NinjaBackend(backends.Backend):
cmd += srcs cmd += srcs
elif i == '@OUTPUT@': elif i == '@OUTPUT@':
cmd += ofilenames cmd += ofilenames
elif '@OUTDIR@' in i:
cmd.append(i.replace('@OUTDIR@', self.get_target_dir(target)))
else: else:
if '@OUTDIR@' in i:
i = i.replace('@OUTDIR@', self.get_target_dir(target))
elif '@PRIVATE_OUTDIR_' in i:
match = re.search('@PRIVATE_OUTDIR_(ABS_)?([a-zA-Z@:]*)@', i)
source = match.group(0)
if match.group(1) is None:
lead_dir = ''
else:
lead_dir = self.environment.get_build_dir()
target_id = match.group(2)
i = i.replace(source,
os.path.join(lead_dir,
self.get_target_dir(self.build.targets[target_id])))
cmd.append(i) cmd.append(i)
elem.add_item('COMMAND', cmd) elem.add_item('COMMAND', cmd)

@ -27,6 +27,6 @@ gnome.generate_gir(
test('gobject introspection/c', girexe) test('gobject introspection/c', girexe)
test('gobject introspection/py', find_program('prog.py'), test('gobject introspection/py', find_program('prog.py'),
env : ['GI_TYPELIB_PATH=@0@'.format(meson.current_build_dir()), env : ['GI_TYPELIB_PATH=meson-out', # HACK to get this running.
'LD_LIBRARY_PATH=@0@'.format(meson.current_build_dir()), 'LD_LIBRARY_PATH=meson-out',
]) ])

Loading…
Cancel
Save