Skip to content

Commit

Permalink
dependencies/jni: Properly resolve jni dep on android
Browse files Browse the repository at this point in the history
The NDK has a jni.h in sysroot/usr/include/, there are no extra native
modules that provide any callable symbols.
  • Loading branch information
sp1ritCS committed Feb 7, 2025
1 parent 0e6e687 commit 678d0b2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mesonbuild/dependencies/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,17 @@ 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 as there is no mechanism to determine the version')

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')
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']
Expand Down

0 comments on commit 678d0b2

Please sign in to comment.