diff options
Diffstat (limited to 'meson/test cases/vala/7 shared library')
6 files changed, 75 insertions, 0 deletions
diff --git a/meson/test cases/vala/7 shared library/lib/meson.build b/meson/test cases/vala/7 shared library/lib/meson.build new file mode 100644 index 000000000..edeeb96d1 --- /dev/null +++ b/meson/test cases/vala/7 shared library/lib/meson.build @@ -0,0 +1,35 @@ +args = [] +# https://github.com/mesonbuild/meson/issues/1969 +if get_option('unity') == 'on' + vala_args = ['-H', 'mylib.h'] +endif + +l = shared_library('valalib', 'mylib.vala', + vala_args : args, + dependencies : valadeps) + +shared_library('installed_vala_lib', 'mylib.vala', + dependencies : valadeps, + install : true) + +shared_library('installed_vala_all', 'mylib.vala', + dependencies : valadeps, + install : true, + install_dir : [true, true, true]) + +shared_library('installed_vala_all_nolib', 'mylib.vala', + dependencies : valadeps, + install : true, + install_dir : [false, + join_paths(get_option('includedir'), 'valah'), + join_paths(get_option('datadir'), 'vala-1.0', 'vapi')]) + +shared_library('installed_vala_onlyh', 'mylib.vala', + dependencies : valadeps, + install : true, + install_dir : [false, get_option('includedir'), false]) + +shared_library('installed_vala_onlyvapi', 'mylib.vala', + dependencies : valadeps, + install : true, + install_dir : [false, false, join_paths(get_option('datadir'), 'vala', 'vapi')]) diff --git a/meson/test cases/vala/7 shared library/lib/mylib.vala b/meson/test cases/vala/7 shared library/lib/mylib.vala new file mode 100644 index 000000000..5cc903bd3 --- /dev/null +++ b/meson/test cases/vala/7 shared library/lib/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/7 shared library/meson.build b/meson/test cases/vala/7 shared library/meson.build new file mode 100644 index 000000000..9c56f1498 --- /dev/null +++ b/meson/test cases/vala/7 shared library/meson.build @@ -0,0 +1,10 @@ +project('shared library', 'vala', 'c') + +valadeps = [dependency('glib-2.0'), dependency('gobject-2.0')] + +libinc = include_directories('lib') + +subdir('lib') +subdir('prog') + +test('valasharedtest', e) diff --git a/meson/test cases/vala/7 shared library/prog/meson.build b/meson/test cases/vala/7 shared library/prog/meson.build new file mode 100644 index 000000000..2b842eac6 --- /dev/null +++ b/meson/test cases/vala/7 shared library/prog/meson.build @@ -0,0 +1,4 @@ +e = executable('valaprog', 'prog.vala', + link_with : l, + include_directories : libinc, + dependencies : valadeps) diff --git a/meson/test cases/vala/7 shared library/prog/prog.vala b/meson/test cases/vala/7 shared library/prog/prog.vala new file mode 100644 index 000000000..3c4a017b1 --- /dev/null +++ b/meson/test cases/vala/7 shared library/prog/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/7 shared library/test.json b/meson/test cases/vala/7 shared library/test.json new file mode 100644 index 000000000..eee3c3dca --- /dev/null +++ b/meson/test cases/vala/7 shared library/test.json @@ -0,0 +1,14 @@ +{ + "installed": [ + {"type": "expr", "file": "usr/lib/?libinstalled_vala_lib.so"}, + {"type": "file", "platform": "cygwin", "file": "usr/lib/libinstalled_vala_lib.dll.a"}, + {"type": "expr", "file": "usr/lib/?libinstalled_vala_all.so"}, + {"type": "file", "platform": "cygwin", "file": "usr/lib/libinstalled_vala_all.dll.a"}, + {"type": "file", "file": "usr/include/installed_vala_all.h"}, + {"type": "file", "file": "usr/include/valah/installed_vala_all_nolib.h"}, + {"type": "file", "file": "usr/include/installed_vala_onlyh.h"}, + {"type": "file", "file": "usr/share/vala/vapi/installed_vala_all.vapi"}, + {"type": "file", "file": "usr/share/vala-1.0/vapi/installed_vala_all_nolib.vapi"}, + {"type": "file", "file": "usr/share/vala/vapi/installed_vala_onlyvapi.vapi"} + ] +} |