[cmake-developers] cmake's built-in support for android using nvidia nsight tegra

Ben Boeckel ben.boeckel at kitware.com
Tue Aug 25 22:17:22 EDT 2015


On Tue, Aug 25, 2015 at 09:59:14 -0500, Peter List wrote:
> // required to avoid run found with adb logcat
> extern void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass
> cls, jobject obj);

There's an SDL_android_main.c file you need to compile. I have a
personal Android/NDK app here:

    https://github.com/mathstuf/abagames-gunroar

but it needs a CMake branch (for D support), uses git-hg to clone SDL
libraries, and uses a patched NDK toolchain for D support. It also only
supports Ninja anyways (make probably works; untested).

If you look in src/android/CMakeLists.txt, there are steps which:

  - install the generated library to the src/android/jni/gunroar
    directory;
  - runs ndk-build;
  - links the assets into place;
  - build the apk using ant;
  - adds a target for installing it to a device.

The src/android/src and src/android/jni/src directories contain the SDL
glue and minimal (NDK) build scripts. Shouldn't be too hard to adapt for
Tegra. It certainly makes APKs which run (but then promptly crash in the
D runtime).

--Ben


More information about the cmake-developers mailing list