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

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

@ -1,11 +1,14 @@
#include "jaggl_X11_dri.h" #include "jaggl_X11_dri.h"
#if defined(__unix__)
#include <dlfcn.h> #include <dlfcn.h>
#include <stddef.h> #include <stddef.h>
static void *jaggl_dri_handle; static void *jaggl_dri_handle;
#endif
JNIEXPORT jboolean JNICALL Java_jaggl_X11_dri_open(JNIEnv *env, jclass cls, jstring path) { JNIEXPORT jboolean JNICALL Java_jaggl_X11_dri_open(JNIEnv *env, jclass cls, jstring path) {
#if defined(__unix__)
if (jaggl_dri_handle) { if (jaggl_dri_handle) {
dlclose(jaggl_dri_handle); dlclose(jaggl_dri_handle);
jaggl_dri_handle = NULL; 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); (*env)->ReleaseStringUTFChars(env, path, path_str);
return jaggl_dri_handle != NULL; return jaggl_dri_handle != NULL;
#else
return JNI_FALSE;
#endif
} }
JNIEXPORT jboolean JNICALL Java_jaggl_X11_dri_close(JNIEnv *env, jclass cls) { JNIEXPORT jboolean JNICALL Java_jaggl_X11_dri_close(JNIEnv *env, jclass cls) {
#if defined(__unix__)
if (jaggl_dri_handle) { if (jaggl_dri_handle) {
dlclose(jaggl_dri_handle); dlclose(jaggl_dri_handle);
jaggl_dri_handle = NULL; jaggl_dri_handle = NULL;
return JNI_TRUE; return JNI_TRUE;
} }
#endif
return JNI_FALSE; return JNI_FALSE;
} }

@ -16,6 +16,8 @@
<module>deob-annotations</module> <module>deob-annotations</module>
<module>game</module> <module>game</module>
<module>gl-natives</module> <module>gl-natives</module>
<module>gl-dri-natives</module>
<module>misc-natives</module>
<module>util</module> <module>util</module>
</modules> </modules>
@ -303,9 +305,6 @@
<family>unix</family> <family>unix</family>
</os> </os>
</activation> </activation>
<modules>
<module>gl-dri-natives</module>
</modules>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -337,9 +336,6 @@
<family>windows</family> <family>windows</family>
</os> </os>
</activation> </activation>
<modules>
<module>misc-natives</module>
</modules>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>

Loading…
Cancel
Save