nandi/jolt-nativepublic Fork 0
384390d0e216cb6f0e9be8e597b9d16e7a64bb29
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Cross-compile for Android, with an NDK nobody has to install 14a30c0 · on 384390d0e216cb6f0e9be8e597b9d16e7a64bb29 · nandi · 19d ago
abi.c · 26 lines · 885 BC Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* What the Android toolchain is asked to prove.
 *
 * Nothing ships this: it is the smallest object that can only compile if the
 * driver really is the NDK's, really is pointed at bionic, and really is
 * building for the device rather than for the host that invoked it. A desktop
 * clang answers every one of these the other way, and __ANDROID_API__ comes
 * from the --target= suffix, so a missing API level fails here too. */
#include <android/api-level.h>
#include <jni.h>

#if !defined(__ANDROID__)
#error "not an Android target"
#endif
#if !defined(__aarch64__)
#error "not an arm64 target"
#endif
#if __ANDROID_API__ < 28
#error "API level below frq's min_sdk_version"
#endif

/* jni.h is a platform header, so reaching it proves the sysroot is the NDK's
 * and not whatever the host has under /usr/include. */
jint jolt_android_abi_ok(void) {
    return __ANDROID_API__;
}