diff options
author | Tristan Partin <tristan@partin.io> | 2022-12-14 19:00:52 -0600 |
---|---|---|
committer | Tristan Partin <tristan@partin.io> | 2022-12-15 20:24:25 -0600 |
commit | 7254db36a7adfa3f5e3e6cbce5dc1e3037893eb9 (patch) | |
tree | 00c40b2fd8f73d4286c4342e8f8176c354cce35c /test cases/java | |
parent | f287cac862d0f55778d75800058994068b3b8627 (diff) | |
download | meson-7254db36a7adfa3f5e3e6cbce5dc1e3037893eb9.zip meson-7254db36a7adfa3f5e3e6cbce5dc1e3037893eb9.tar.gz meson-7254db36a7adfa3f5e3e6cbce5dc1e3037893eb9.tar.bz2 |
Try to find the jni dependency when javac is a Darwin stub
Darwin-based systems, at least macOS, provide various JDK executable
stubs in
/System/Library/Frameworks/JavaVM.framework/Versions/*/Commands.
These stubs are placed in such a way that they break the heuristics of
the JNI system dependency. If a javac being analyzed to find a Java home
is a stub, use /usr/libexec/java_home.
See https://stackoverflow.com/a/15133344/7572728 for more details.
Closes #11173
Diffstat (limited to 'test cases/java')
-rw-r--r-- | test cases/java/9 jni/meson.build | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test cases/java/9 jni/meson.build b/test cases/java/9 jni/meson.build index 90a8485..7a68165 100644 --- a/test cases/java/9 jni/meson.build +++ b/test cases/java/9 jni/meson.build @@ -11,10 +11,16 @@ endif fs = import('fs') javamod = import('java') +cc = meson.get_compiler('c') java = find_program('java') jni_dep = dependency('jni', version : '>=1.8', modules: ['jvm', 'awt']) +# Assert that the header can actually be found with the dependency. +cc.has_header('jni.h', dependencies: [jni_dep]) +# Assert that the platform-specific include directory is included in the compiler arguments. +cc.has_header('jni_md.h', dependencies: [jni_dep]) + # generate native headers subdir('src') subdir('lib') |