Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Added Android build support #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

julhe
Copy link

@julhe julhe commented Apr 8, 2020

I've added support for Android. Over a simple AndroidStudio project, the CMake project is compiled with Androids toolchain and bundled into a single AAR file. I've tested it successfully on Android 9 and Unity 2019.3.

Had to do some changes to the CMake files to make it work, someone with more C++/CMake proficiency might wanna review them. 🙂

Changelog as follows:

  • Added android build project. Launch a build with "build-android.cmd"
  • removed instances of "set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")" in various CMakeLists, because they would break compatibility with Android at runtime.
  • added whitespace to target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_IMPL_API="extern " C" ") to enable compilation on C++11 (Android default). (unsure about this. It works, but it "feels" wierd)

To build you need:

  • Android Studio, including NDK and CMake
  • Java Runtime 1.8+
  • Java DevKit (JDK) 1.8+ (must match Runtime version)

added android build project. Launch a build with "build-android.cmd"
removed instances of "set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")" in various CMakeLists, because they would break compatibility with Android at runtime.
added whitespace to target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_IMPL_API="extern \" C\" ") to enable compilation on C++11 (Android default). (unsure about this)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant