~akavel

Recent activity

Building an Android JNI library with `zig --c-source` 5 years ago

From Mateusz Czaplinski to ~andrewrk/ziglang

Hi!
I wanted to let you know, that with
https://github.com/ziglang/zig/pull/2477 merged today, I managed to
cross-compile a simple JNI .c to a .so library working on Android, as
part of an .apk, using Zig's builtin CC (as of the current
"master"/bleeding edge build of Zig).

The C file was from the following URL:
https://github.com/akavel/hellomello/blob/7a5b408fe52104c6787d40f741cd67db671d4ff9/exp/hello-jni.c
-- that is, the following code:

  #include <string.h>
  #include "jni.h"