diff options
Diffstat (limited to 'meson/test cases/vala/6 static library')
4 files changed, 34 insertions, 0 deletions
diff --git a/meson/test cases/vala/6 static library/meson.build b/meson/test cases/vala/6 static library/meson.build new file mode 100644 index 000000000..c74bdf89b --- /dev/null +++ b/meson/test cases/vala/6 static library/meson.build @@ -0,0 +1,17 @@ +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, +dependencies : valadeps) + +test('valastatictest', e) diff --git a/meson/test cases/vala/6 static library/mylib.vala b/meson/test cases/vala/6 static library/mylib.vala new file mode 100644 index 000000000..5cc903bd3 --- /dev/null +++ b/meson/test cases/vala/6 static library/mylib.vala @@ -0,0 +1,5 @@ +public class LibraryObject : Object { + public void func() { + stdout.printf("Method in library called."); + } +} diff --git a/meson/test cases/vala/6 static library/prog.vala b/meson/test cases/vala/6 static library/prog.vala new file mode 100644 index 000000000..3c4a017b1 --- /dev/null +++ b/meson/test cases/vala/6 static library/prog.vala @@ -0,0 +1,7 @@ +class MainApp : Object { + public static int main(string[] args) { + var l = new LibraryObject(); + l.func(); + return 0; + } +} diff --git a/meson/test cases/vala/6 static library/test.json b/meson/test cases/vala/6 static library/test.json new file mode 100644 index 000000000..d85ef6daf --- /dev/null +++ b/meson/test cases/vala/6 static library/test.json @@ -0,0 +1,5 @@ +{ + "installed": [ + {"type": "file", "file": "usr/lib/libextractedlib.a"} + ] +} |