From 3270185ae35b745f2e9a61932c1413e9aa82d49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Wed, 5 Feb 2025 14:42:32 +0100 Subject: [PATCH] dependencies/jni: Properly resolve jni dep on android The NDK has a jni.h in sysroot/usr/include/, there are no extra native modules that provide any callable symbols. --- mesonbuild/dependencies/dev.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index 2725a7bb4e88..1f1a061318d0 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -568,6 +568,19 @@ def __init__(self, environment: 'Environment', kwargs: JNISystemDependencyKW): m = self.env.machines[self.for_machine] + if m.is_android(): + if kwargs.get('version'): + mlog.warning('Ignoring JNI version requirements because there is no mechanism to', + 'determine the version on Android', + fatal=False) + + self.is_found, _ = self.clib_compiler.has_header('jni.h', '', environment, dependencies=[self]) + if kwargs.get('modules'): + mlog.warning('Android does not provide JNI modules', fatal=False) + self.is_found = False + + return + if 'java' not in environment.coredata.compilers[self.for_machine]: detect_compiler(self.name, environment, self.for_machine, 'java') self.javac = environment.coredata.compilers[self.for_machine]['java']