| Cross-compile for Android, with an NDK nobody has to install 14a30c0 nandi 19d ago | 1 | /* 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. */ |
| 23 | jint jolt_android_abi_ok(void) { |
| 24 | return __ANDROID_API__; |
| 25 | } |
| 26 | |