aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/vala/4 config
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/vala/4 config')
-rw-r--r--meson/test cases/vala/4 config/config.vapi1
-rw-r--r--meson/test cases/vala/4 config/meson-something-else.vapi1
-rw-r--r--meson/test cases/vala/4 config/meson.build15
-rw-r--r--meson/test cases/vala/4 config/prog.vala8
4 files changed, 25 insertions, 0 deletions
diff --git a/meson/test cases/vala/4 config/config.vapi b/meson/test cases/vala/4 config/config.vapi
new file mode 100644
index 000000000..68454175f
--- /dev/null
+++ b/meson/test cases/vala/4 config/config.vapi
@@ -0,0 +1 @@
+public const string DATA_DIRECTORY;
diff --git a/meson/test cases/vala/4 config/meson-something-else.vapi b/meson/test cases/vala/4 config/meson-something-else.vapi
new file mode 100644
index 000000000..ce2b83a73
--- /dev/null
+++ b/meson/test cases/vala/4 config/meson-something-else.vapi
@@ -0,0 +1 @@
+public const string SOMETHING_ELSE;
diff --git a/meson/test cases/vala/4 config/meson.build b/meson/test cases/vala/4 config/meson.build
new file mode 100644
index 000000000..7cb93cf73
--- /dev/null
+++ b/meson/test cases/vala/4 config/meson.build
@@ -0,0 +1,15 @@
+project('valatest', 'vala', 'c')
+
+valac = meson.get_compiler('vala')
+# Try to find our library
+valadeps = [valac.find_library('meson-something-else', dirs : meson.current_source_dir())]
+valadeps += [dependency('glib-2.0'), dependency('gobject-2.0')]
+
+e = executable(
+'valaprog',
+sources : ['config.vapi', 'prog.vala'],
+dependencies : valadeps,
+c_args : ['-DDATA_DIRECTORY="@0@"'.format(meson.current_source_dir()),
+ '-DSOMETHING_ELSE="Out of this world!"']
+)
+test('valatest', e)
diff --git a/meson/test cases/vala/4 config/prog.vala b/meson/test cases/vala/4 config/prog.vala
new file mode 100644
index 000000000..2b08dadb6
--- /dev/null
+++ b/meson/test cases/vala/4 config/prog.vala
@@ -0,0 +1,8 @@
+class MainProg : GLib.Object {
+
+ public static int main(string[] args) {
+ stdout.printf("DATA_DIRECTORY is: %s.\n", DATA_DIRECTORY);
+ stdout.printf("SOMETHING_ELSE is: %s.\n", SOMETHING_ELSE);
+ return 0;
+ }
+}