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

@ -13,22 +13,32 @@
<name>OpenRS2 GL DRI Natives</name>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<linker>
<sysLibs>
<sysLib>
<type>shared</type>
<name>dl</name>
</sysLib>
</sysLibs>
</linker>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>unix</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<linker>
<sysLibs>
<sysLib>
<type>shared</type>
<name>dl</name>
</sysLib>
</sysLibs>
</linker>
</configuration>
</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;
}

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

Loading…
Cancel
Save