nandi/jolt-nativepublic Fork 0
dce285fb5a5ec1f331b8afa7b2bdc4ed5e1bbd46
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.

abi.c · 26 lines · 885 BC Blame HistoryRaw
Cross-compile for Android, with an NDK nobody has to install 14a30c0 nandi 19d ago1/* What the Android toolchain is asked to prove.
2 *
3 * Nothing ships this: it is the smallest object that can only compile if the
4 * driver really is the NDK's, really is pointed at bionic, and really is
5 * building for the device rather than for the host that invoked it. A desktop
6 * clang answers every one of these the other way, and __ANDROID_API__ comes
7 * from the --target= suffix, so a missing API level fails here too. */
8#include <android/api-level.h>
9#include <jni.h>
10
11#if !defined(__ANDROID__)
12#error "not an Android target"
13#endif
14#if !defined(__aarch64__)
15#error "not an arm64 target"
16#endif
17#if __ANDROID_API__ < 28
18#error "API level below frq's min_sdk_version"
19#endif
20
21/* jni.h is a platform header, so reaching it proves the sysroot is the NDK's
22 * and not whatever the host has under /usr/include. */
23jint jolt_android_abi_ok(void) {
24 return __ANDROID_API__;
25}
26