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.
master
Graham 5 years ago
parent fb3b0b59c3
commit fd452147c5
  1. 10
      gl-dri-natives/pom.xml
  2. 8
      gl-dri-natives/src/main/c/jaggl_dri.c

@ -13,6 +13,14 @@
<name>OpenRS2 GL DRI Natives</name>
<profiles>
<profile>
<id>unix</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<build>
<plugins>
<plugin>
@ -31,4 +39,6 @@
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

@ -1,11 +1,14 @@
#include "jaggl_X11_dri.h"
#if defined(__unix__)
#include <dlfcn.h>
#include <stddef.h>
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;
}

Loading…
Cancel
Save