diff options
author | Tristan Partin <tristan@partin.io> | 2022-03-01 17:35:01 -0600 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-03-04 13:52:21 -0500 |
commit | 498db2764c6d8bf9c9362b77a4011d8197879460 (patch) | |
tree | dc5c2eb626d7abdba4155a3a356d84c73e4e1785 /docs/markdown | |
parent | e082f268bdfe2351bf7fc68733a1dda8e2f7ac5a (diff) | |
download | meson-498db2764c6d8bf9c9362b77a4011d8197879460.zip meson-498db2764c6d8bf9c9362b77a4011d8197879460.tar.gz meson-498db2764c6d8bf9c9362b77a4011d8197879460.tar.bz2 |
Add modules kwarg to JNI system dep
This allows someone to link against libjvm.so and libjawt.so.
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Dependencies.md | 17 | ||||
-rw-r--r-- | docs/markdown/snippets/jni-system-dep-modules.md | 10 |
2 files changed, 24 insertions, 3 deletions
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md index a7e34e5..8165955 100644 --- a/docs/markdown/Dependencies.md +++ b/docs/markdown/Dependencies.md @@ -494,23 +494,34 @@ Deprecated name for JNI. `dependency('jdk')` instead of `dependency('jni')`. *(added 0.62.0)* +`modules` is an optional list of strings containing any of `jvm` and `awt`. + Provides access to compiling with the Java Native Interface (JNI). The lookup will first check if `JAVA_HOME` is set in the environment, and if not will use the resolved path of `javac`. Systems will usually link your preferred JDK to well known paths like `/usr/bin/javac` on Linux for instance. Using the path from `JAVA_HOME` or the resolved `javac`, this dependency will place the JDK installation's `include` directory and its platform-dependent subdirectory on -the compiler's include path. +the compiler's include path. If `modules` is non-empty, then the proper linker +arguments will also be added. ```meson -dep = dependency('jni', version: '>= 1.8.0') +dep = dependency('jni', version: '>= 1.8.0', modules: ['jvm']) ``` **Note**: Due to usage of a resolved path, upgrading the JDK may cause the -various headers to not be found. In that case, please reconfigure the build +various paths to not be found. In that case, please reconfigure the build directory. One workaround is to explicitly set `JAVA_HOME` instead of relying on the fallback `javac` resolved path behavior. +**Note**: Include paths might be broken on platforms other than `linux`, +`windows`, `darwin`, and `sunos`. Please submit a PR or open an issue in this +case. + +**Note**: Use of the `modules` argument on a JDK `<= 1.8` may be broken if your +system is anything other than `x86_64`. Please submit a PR or open an issue in +this case. + ## libgcrypt *(added 0.49.0)* diff --git a/docs/markdown/snippets/jni-system-dep-modules.md b/docs/markdown/snippets/jni-system-dep-modules.md new file mode 100644 index 0000000..1f2c567 --- /dev/null +++ b/docs/markdown/snippets/jni-system-dep-modules.md @@ -0,0 +1,10 @@ +## JNI System Dependency Modules + +The JNI system dependency now supports a `modules` keyword argument which is a +list containing any of the following: `jvm`, `awt`. + +```meson +jni_dep = dependency('jni', version: '>= 1.8.0', modules: ['jvm', 'awt']) +``` + +This will add appropriate linker arguments to your target. |