Now that we have the complete Java language module optionally added (where available) we should be able to use Meson's own jar target rather than manually packaging it. Again thanks to Eli Schwartz here

This commit is contained in:
Chris Cannam
2022-10-13 13:29:18 +01:00
parent 16698932d8
commit 1595fcb47e

View File

@@ -133,11 +133,11 @@ have_sincos = cpp.has_function('sincos',
# Schwartz for the fix here; this has been through a few previous # Schwartz for the fix here; this has been through a few previous
# iterations. Initially we just looked for jni.h, but it's often in an # iterations. Initially we just looked for jni.h, but it's often in an
# obscure place so that didn't work very well. Then tried Meson's # obscure place so that didn't work very well. Then tried Meson's
# automatic dependency('jni') handling, but that fails in Meson # automatic dependency('jni') handling, but that bails out in Meson
# 0.62/0.63 if javac is not present (even if required is false). Then # 0.62/0.63 if javac is not present (even if required is false). Then
# tried guarding that check behind a successful find_program('javac'), # tried guarding that check behind a successful find_program('javac'),
# but that fails on systems in which a stub javac is installed that is # but that bails out on systems in which a stub javac is installed
# not a compiler (because the subsequent Meson jni magic still # that is not a compiler (because the subsequent Meson jni magic still
# requires javac as a compiler). Now try adding Java as a complete # requires javac as a compiler). Now try adding Java as a complete
# language pack, optionally, and only go on to JNI if that succeeds, # language pack, optionally, and only go on to JNI if that succeeds,
# making sure that nothing "clever" happens if Java is not found. # making sure that nothing "clever" happens if Java is not found.
@@ -630,21 +630,7 @@ if have_java and jni_dep.found()
# NB the JNI library is not versioned # NB the JNI library is not versioned
install: true, install: true,
) )
javac = find_program('javac') jar('rubberband', 'com/breakfastquay/rubberband/RubberBandStretcher.java')
jar = find_program('jar')
rubberband_class = custom_target(
'rubberband_class',
input: 'com/breakfastquay/rubberband/RubberBandStretcher.java',
output: 'RubberBandStretcher.class',
command: [ javac, '@INPUT@', '-d', '@OUTDIR@' ],
)
rubberband_jar = custom_target(
'rubberband_jar',
input: rubberband_class,
output: 'rubberband.jar',
command: [ jar, 'cvf', '@OUTPUT@', 'com/breakfastquay/rubberband/@INPUT@' ],
build_by_default: true,
)
else else
target_summary += { 'JNI library': false } target_summary += { 'JNI library': false }
if not have_java if not have_java