diff options
author | Sven Gothel <[email protected]> | 2023-06-29 02:18:18 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-06-29 02:18:18 +0200 |
commit | ce542531f4cb6fe2bf37f3926ea869722e5acf7d (patch) | |
tree | 12743ccbf43fec5a5d8da2a5abba1e5831cc80cd /src/java/com/jogamp/gluegen/JavaConfiguration.java | |
parent | 9f69f8b60b9fdc80076e20f303252ddd35b97ccf (diff) |
GlueGen LibraryOnLoad Config: Generate `JNI_OnLoad(..)` for dynamic and `JNI_OnLoad_<LibraryBasename>(..)` for static libraries and `JVMUtil_GetJNIEnv(..)` to resolve the `JNIEnv*` as used by JavaCallback
Diffstat (limited to 'src/java/com/jogamp/gluegen/JavaConfiguration.java')
-rw-r--r-- | src/java/com/jogamp/gluegen/JavaConfiguration.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaConfiguration.java b/src/java/com/jogamp/gluegen/JavaConfiguration.java index 30ccbb2..3faddcd 100644 --- a/src/java/com/jogamp/gluegen/JavaConfiguration.java +++ b/src/java/com/jogamp/gluegen/JavaConfiguration.java @@ -62,6 +62,7 @@ import static com.jogamp.gluegen.JavaEmitter.EmissionStyle.*; public class JavaConfiguration { private int nestedReads; + private String libraryOnLoadName; private String packageName; private String implPackageName; private String className; @@ -284,6 +285,11 @@ public class JavaConfiguration { public void setOutputRootDir(final String s) { outputRootDir=s; } + /** Returns the library basename used to {@link CCodeUnit#emitJNIOnLoadJNIEnvCode(String)}. */ + public String libraryOnLoadName() { + return libraryOnLoadName; + } + /** Returns the package name parsed from the configuration file. */ public String packageName() { return packageName; @@ -1310,8 +1316,10 @@ public class JavaConfiguration { protected void dispatch(final String cmd, final StringTokenizer tok, final File file, final String filename, final int lineNo) throws IOException { //System.err.println("read cmd = [" + cmd + "]"); - if (cmd.equalsIgnoreCase("Package")) { - packageName = readString("package", tok, filename, lineNo); + if (cmd.equalsIgnoreCase("LibraryOnLoad")) { + libraryOnLoadName = readString("LibraryOnLoad", tok, filename, lineNo); + } else if (cmd.equalsIgnoreCase("Package")) { + packageName = readString("Package", tok, filename, lineNo); } else if (cmd.equalsIgnoreCase("GlueGenRuntimePackage")) { gluegenRuntimePackage = readString("GlueGenRuntimePackage", tok, filename, lineNo); } else if (cmd.equalsIgnoreCase("ImplPackage")) { |