aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/java/9 jdk/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/java/9 jdk/lib')
-rw-r--r--meson/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.c9
-rw-r--r--meson/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.h21
-rw-r--r--meson/test cases/java/9 jdk/lib/meson.build14
-rw-r--r--meson/test cases/java/9 jdk/lib/native.c11
4 files changed, 55 insertions, 0 deletions
diff --git a/meson/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.c b/meson/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.c
new file mode 100644
index 000000000..075e37b2b
--- /dev/null
+++ b/meson/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.c
@@ -0,0 +1,9 @@
+#include <jni.h>
+
+#include "com_mesonbuild_JdkTest.h"
+
+JNIEXPORT jint JNICALL Java_com_mesonbuild_JdkTest_jdk_1test
+ (JNIEnv *env, jclass clazz)
+{
+ return (jint)0xdeadbeef;
+}
diff --git a/meson/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.h b/meson/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.h
new file mode 100644
index 000000000..40083ac9b
--- /dev/null
+++ b/meson/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.h
@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_mesonbuild_JdkTest */
+
+#ifndef _Included_com_mesonbuild_JdkTest
+#define _Included_com_mesonbuild_JdkTest
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: com_mesonbuild_JdkTest
+ * Method: jdk_test
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_com_mesonbuild_JdkTest_jdk_1test
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/meson/test cases/java/9 jdk/lib/meson.build b/meson/test cases/java/9 jdk/lib/meson.build
new file mode 100644
index 000000000..a94776972
--- /dev/null
+++ b/meson/test cases/java/9 jdk/lib/meson.build
@@ -0,0 +1,14 @@
+sources = files(
+ 'native.c',
+ 'com_mesonbuild_JdkTest.c',
+)
+
+jdkjava = shared_module(
+ 'jdkjava',
+ sources,
+ dependencies : [jdk],
+)
+
+jdkjava_dep = declare_dependency(
+ link_with : jdkjava,
+)
diff --git a/meson/test cases/java/9 jdk/lib/native.c b/meson/test cases/java/9 jdk/lib/native.c
new file mode 100644
index 000000000..0b5e71890
--- /dev/null
+++ b/meson/test cases/java/9 jdk/lib/native.c
@@ -0,0 +1,11 @@
+#include <jni.h>
+
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved)
+{
+ return JNI_VERSION_1_8;
+}
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved)
+{}