From fc7583c58ae4281581256f9ad51cf8daed333c3d Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 10 Aug 2019 11:59:52 +0100 Subject: [PATCH] Build all natives on all platforms On unsupported platforms we stub out the methods. I'm thinking about using the Maven site plugin to manage the project website, and it is nicer for documentation purposes for all of the modules to be available in the site regardless of the platform it is built on. --- gl-dri-natives/pom.xml | 46 ++++++++++++++++----------- gl-dri-natives/src/main/c/jaggl_dri.c | 8 +++++ pom.xml | 8 ++--- 3 files changed, 38 insertions(+), 24 deletions(-) diff --git a/gl-dri-natives/pom.xml b/gl-dri-natives/pom.xml index 29e8fd2b09..75592f6895 100644 --- a/gl-dri-natives/pom.xml +++ b/gl-dri-natives/pom.xml @@ -13,22 +13,32 @@ OpenRS2 GL DRI Natives - - - - com.github.maven-nar - nar-maven-plugin - - - - - shared - dl - - - - - - - + + + unix + + + unix + + + + + + com.github.maven-nar + nar-maven-plugin + + + + + shared + dl + + + + + + + + + diff --git a/gl-dri-natives/src/main/c/jaggl_dri.c b/gl-dri-natives/src/main/c/jaggl_dri.c index 520d4e43d4..a28ac0fd9b 100644 --- a/gl-dri-natives/src/main/c/jaggl_dri.c +++ b/gl-dri-natives/src/main/c/jaggl_dri.c @@ -1,11 +1,14 @@ #include "jaggl_X11_dri.h" +#if defined(__unix__) #include #include static void *jaggl_dri_handle; +#endif JNIEXPORT jboolean JNICALL Java_jaggl_X11_dri_open(JNIEnv *env, jclass cls, jstring path) { +#if defined(__unix__) if (jaggl_dri_handle) { dlclose(jaggl_dri_handle); jaggl_dri_handle = NULL; @@ -16,14 +19,19 @@ JNIEXPORT jboolean JNICALL Java_jaggl_X11_dri_open(JNIEnv *env, jclass cls, jstr (*env)->ReleaseStringUTFChars(env, path, path_str); return jaggl_dri_handle != NULL; +#else + return JNI_FALSE; +#endif } JNIEXPORT jboolean JNICALL Java_jaggl_X11_dri_close(JNIEnv *env, jclass cls) { +#if defined(__unix__) if (jaggl_dri_handle) { dlclose(jaggl_dri_handle); jaggl_dri_handle = NULL; return JNI_TRUE; } +#endif return JNI_FALSE; } diff --git a/pom.xml b/pom.xml index 5f0723e4ad..287765f10b 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,8 @@ deob-annotations game gl-natives + gl-dri-natives + misc-natives util @@ -303,9 +305,6 @@ unix - - gl-dri-natives - @@ -337,9 +336,6 @@ windows - - misc-natives -