gnome:generate_gir: Parse "link_with"

In case g-ir-scanner has to link with other dependencies.
pull/145/head
Mathieu Duponchelle 10 years ago
parent 048d317085
commit acb78ce8e6
  1. 14
      modules/gnome.py

@ -55,6 +55,7 @@ class GnomeModule:
nsversion = kwargs.pop('nsversion')
libsources = kwargs.pop('sources')
girfile = '%s-%s.gir' % (ns, nsversion)
depends = [girtarget]
scan_command = ['g-ir-scanner', '@INPUT@']
scan_command += pkgargs
@ -65,6 +66,17 @@ class GnomeModule:
for incdir in incdirs.get_incdirs():
scan_command += ['-I%s' % os.path.join(state.environment.get_source_dir(), incdir)]
if 'link_with' in kwargs:
link_with = kwargs.pop('link_with')
for link in link_with:
lib = link.held_object
scan_command += ['-l%s' % lib.name]
if isinstance(lib, build.SharedLibrary):
scan_command += ['-L%s' %
os.path.join(state.environment.get_build_dir(),
lib.subdir)]
depends.append(lib)
if 'includes' in kwargs:
includes = kwargs.pop('includes')
if isinstance(includes, str):
@ -122,7 +134,7 @@ class GnomeModule:
scankwargs = {'output' : girfile,
'input' : libsources,
'command' : scan_command,
'depends' : girtarget,
'depends' : depends,
}
if kwargs.get('install'):
scankwargs['install'] = kwargs['install']

Loading…
Cancel
Save