aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/JavaEmitter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/gluegen/JavaEmitter.java')
-rw-r--r--src/java/com/jogamp/gluegen/JavaEmitter.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java
index 3a86239..939ce92 100644
--- a/src/java/com/jogamp/gluegen/JavaEmitter.java
+++ b/src/java/com/jogamp/gluegen/JavaEmitter.java
@@ -2980,7 +2980,10 @@ public class JavaEmitter implements GlueEmitter {
}
if (cfg.emitImpl()) {
- cUnit().emitHeader(getImplPackageName(), cfg.implClassName(), cfg.customCCode());
+ if( !cfg.getJavaCallbackList().isEmpty() && null == cfg.libraryOnLoadName() ) {
+ LOG.log(WARNING, "JavaCallback used, but no 'LibraryOnLoad' basename specified for JNI_OnLoad(..). Exactly one native code-unit for the library must specify with 'LibraryOnLoad' basename");
+ }
+ cUnit().emitHeader(cfg.libraryOnLoadName(), getImplPackageName(), cfg.implClassName(), cfg.customCCode());
}
} catch (final Exception e) {
throw new RuntimeException(
@@ -3004,6 +3007,9 @@ public class JavaEmitter implements GlueEmitter {
javaImplUnit.emitTailCode();
javaImplUnit().emitln("} // end of class " + cfg.implClassName());
}
+ if (cfg.emitImpl() && null != cfg.libraryOnLoadName() ) {
+ cUnit.emitJNIOnLoadJNIEnvCode(cfg.libraryOnLoadName());
+ }
}
private JavaType javaType(final Class<?> c) {