Skip to content

Commit

Permalink
Finally full test suite passes, even gir.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Sep 3, 2015
1 parent 0131555 commit a90bbb7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
7 changes: 6 additions & 1 deletion interpreter.py
Expand Up @@ -453,7 +453,9 @@ def __init__(self, target):
super().__init__()
self.held_object = target
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):
return self.held_object.is_cross()
Expand All @@ -466,6 +468,9 @@ def extract_all_objects_method(self, args, kwargs):
gobjs = self.held_object.extract_all_objects()
return GeneratedObjectsHolder(gobjs)

def get_id_method(self, args, kwargs):
return self.held_object.get_id()

class ExecutableHolder(BuildTargetHolder):
def __init__(self, target):
super().__init__(target)
Expand Down
6 changes: 3 additions & 3 deletions modules/gnome.py
Expand Up @@ -147,7 +147,7 @@ def generate_gir(self, state, args, kwargs):
if isinstance(girtarget, build.Executable):
scan_command += ['--program', girtarget]
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()
scan_command += ['--library', libname]
scankwargs = {'output' : girfile,
Expand All @@ -163,9 +163,9 @@ def generate_gir(self, state, args, kwargs):
typelib_output = '%s-%s.typelib' % (ns, nsversion)
typelib_cmd = ['g-ir-compiler', scan_target, '--output', '@OUTPUT@']
if inc_dirs:
for id in inc_dirs:
for incd in inc_dirs:
typelib_cmd += ['--includedir=%s' % inc for inc in
id.held_object.get_incdirs()]
incd.held_object.get_incdirs()]
if deps:
for dep in deps:
girdir = dep.held_object.get_variable ("girdir")
Expand Down
15 changes: 13 additions & 2 deletions ninjabackend.py
Expand Up @@ -306,9 +306,20 @@ def generate_custom_target(self, target, outfile):
cmd += srcs
elif i == '@OUTPUT@':
cmd += ofilenames
elif '@OUTDIR@' in i:
cmd.append(i.replace('@OUTDIR@', self.get_target_dir(target)))
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)

elem.add_item('COMMAND', cmd)
Expand Down
4 changes: 2 additions & 2 deletions test cases/frameworks/7 gnome/gir/meson.build
Expand Up @@ -27,6 +27,6 @@ gnome.generate_gir(

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

0 comments on commit a90bbb7

Please sign in to comment.