vala: Fix compiled object extraction

Fixes #791
pull/1022/head
Nirbheek Chauhan 9 years ago committed by Jussi Pakkanen
parent 434bb03743
commit 45996b0f92
  1. 3
      mesonbuild/backend/backends.py
  2. 1
      test cases/vala/6 static library/installed_files.txt
  3. 6
      test cases/vala/6 static library/meson.build

@ -271,6 +271,9 @@ class Backend():
def object_filename_from_source(self, target, source):
if isinstance(source, mesonlib.File):
source = source.fname
# foo.vala files compile down to foo.c and then foo.c.o, not foo.vala.o
if source.endswith('.vala'):
source = os.path.join(self.get_target_private_dir(target), source[:-5] + '.c')
return source.replace('/', '_').replace('\\', '_') + '.' + self.environment.get_object_suffix()
def determine_ext_objs(self, extobj, proj_dir_to_build_root):

@ -3,6 +3,12 @@ project('valastatic', 'vala', 'c')
valadeps = [dependency('glib-2.0'), dependency('gobject-2.0')]
l = static_library('valalib', 'mylib.vala', dependencies : valadeps)
# NOTE: This static library is not usable from Vala because it does not carry
# forward the .vapi and .h files generated by Valac to the next BuildTarget.
# Will have to be fixed with https://github.com/mesonbuild/meson/issues/891
m = static_library('extractedlib',
objects : l.extract_all_objects(),
install : true)
e = executable('valaprog', 'prog.vala',
link_with : l,

Loading…
Cancel
Save