| 1 |
project('jnijava', ['c', 'java']) |
| 2 |
|
| 3 |
if build_machine.system() == 'cygwin' |
| 4 |
error('MESON_SKIP_TEST: cygwin test failures') |
| 5 |
endif |
| 6 |
|
| 7 |
if build_machine.system() == 'windows' and build_machine.cpu_family() == 'x86' |
| 8 |
error('MESON_SKIP_TEST: failing builds on 32bit Windows because a 32bit JDK is not available in the Azure Pipelines Windows images') |
| 9 |
endif |
| 10 |
|
| 11 |
fs = import('fs') |
| 12 |
javamod = import('java') |
| 13 |
|
| 14 |
cc = meson.get_compiler('c') |
| 15 |
java = find_program('java') |
| 16 |
|
| 17 |
jni_dep = dependency('jni', version : '>=1.8', modules: ['jvm', 'awt']) |
| 18 |
|
| 19 |
# Assert that the header can actually be found with the dependency. |
| 20 |
cc.has_header('jni.h', dependencies: [jni_dep], required: true) |
| 21 |
# Assert that the platform-specific include directory is included in the compiler arguments. |
| 22 |
cc.has_header('jni_md.h', dependencies: [jni_dep], required: true) |
| 23 |
|
| 24 |
# generate native headers |
| 25 |
subdir('src') |
| 26 |
subdir('lib') |
| 27 |
|
| 28 |
test( |
| 29 |
'jnitest', |
| 30 |
java, |
| 31 |
args: [ |
| 32 |
'-Djava.library.path=@0@'.format(fs.parent(jnijava.full_path())), |
| 33 |
'-jar', |
| 34 |
jnijar, |
| 35 |
], |
| 36 |
protocol : 'exitcode', |
| 37 |
depends : [jnijava], |
| 38 |
) |