INSTALL.md.in 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. This Android archive allows use of @PROJECT_NAME@ in your Android project, without needing to copy any SDL source.
  2. For integration with CMake/ndk-build, it uses [prefab](https://google.github.io/prefab/).
  3. Copy this archive (@PROJECT_NAME@-@PROJECT_VERSION@.aar) to a `app/libs` directory of your project.
  4. In `app/build.gradle` of your Android project, add:
  5. ```
  6. android {
  7. /* ... */
  8. buildFeatures {
  9. prefab true
  10. }
  11. }
  12. dependencies {
  13. implementation files('libs/@PROJECT_NAME@-@PROJECT_VERSION@.aar')
  14. /* ... */
  15. }
  16. ```
  17. If you're using CMake, add the following to your CMakeLists.txt:
  18. ```
  19. find_package(@PROJECT_NAME@ REQUIRED CONFIG)
  20. target_link_libraries(yourgame PRIVATE @PROJECT_NAME@::@PROJECT_NAME@)
  21. ```
  22. If you're using ndk-build, add the following somewhere after `LOCAL_MODULE := yourgame` to your `Android.mk` or `Application.mk`:
  23. ```
  24. # https://google.github.io/prefab/build-systems.html
  25. # Add the prefab modules to the import path.
  26. $(call import-add-path,/out)
  27. # Import @PROJECT_NAME@ so we can depend on it.
  28. $(call import-module,prefab/@PROJECT_NAME@)
  29. ```
  30. ---
  31. For advanced users:
  32. If you want to build a 3rd party library outside Gradle,
  33. running the following command will extract the Android archive into a more common directory structure.
  34. ```
  35. python @PROJECT_NAME@-@PROJECT_VERSION@.aar -o android_prefix
  36. ```
  37. Add `--help` for a list of all available options.
  38. Look at the example programs in ./test (of the source archive), and check out online documentation:
  39. https://wiki.libsdl.org/SDL3/FrontPage
  40. Join the SDL discourse server if you want to join the community:
  41. https://discourse.libsdl.org/
  42. That's it!
  43. Sam Lantinga <slouken@libsdl.org>