summaryrefslogtreecommitdiffstats
path: root/test cases/vala/6 static library
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
commit7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch)
tree4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/vala/6 static library
parentInitial commit. (diff)
downloadmeson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz
meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/vala/6 static library')
-rw-r--r--test cases/vala/6 static library/meson.build17
-rw-r--r--test cases/vala/6 static library/mylib.vala5
-rw-r--r--test cases/vala/6 static library/prog.vala7
-rw-r--r--test cases/vala/6 static library/test.json5
4 files changed, 34 insertions, 0 deletions
diff --git a/test cases/vala/6 static library/meson.build b/test cases/vala/6 static library/meson.build
new file mode 100644
index 0000000..c74bdf8
--- /dev/null
+++ b/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/test cases/vala/6 static library/mylib.vala b/test cases/vala/6 static library/mylib.vala
new file mode 100644
index 0000000..5cc903b
--- /dev/null
+++ b/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/test cases/vala/6 static library/prog.vala b/test cases/vala/6 static library/prog.vala
new file mode 100644
index 0000000..3c4a017
--- /dev/null
+++ b/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/test cases/vala/6 static library/test.json b/test cases/vala/6 static library/test.json
new file mode 100644
index 0000000..d85ef6d
--- /dev/null
+++ b/test cases/vala/6 static library/test.json
@@ -0,0 +1,5 @@
+{
+ "installed": [
+ {"type": "file", "file": "usr/lib/libextractedlib.a"}
+ ]
+}