INSTALL.md.in 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Using this package
  2. This package contains SDL built for the Android platform.
  3. ## Gradle integration
  4. For integration with CMake/ndk-build, it uses [prefab](https://google.github.io/prefab/).
  5. Copy the aar archive (@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar) to a `app/libs` directory of your project.
  6. In `app/build.gradle` of your Android project, add:
  7. ```
  8. android {
  9. /* ... */
  10. buildFeatures {
  11. prefab true
  12. }
  13. }
  14. dependencies {
  15. implementation files('libs/@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar')
  16. /* ... */
  17. }
  18. ```
  19. If you're using CMake, add the following to your CMakeLists.txt:
  20. ```
  21. find_package(@<@PROJECT_NAME@>@ REQUIRED CONFIG)
  22. target_link_libraries(yourgame PRIVATE @<@PROJECT_NAME@>@::@<@PROJECT_NAME@>@)
  23. ```
  24. If you use ndk-build, add the following before `include $(BUILD_SHARED_LIBRARY)` to your `Android.mk`:
  25. ```
  26. LOCAL_SHARED_LIBARARIES := SDL3 SDL3-Headers
  27. ```
  28. And add the following at the bottom:
  29. ```
  30. # https://google.github.io/prefab/build-systems.html
  31. # Add the prefab modules to the import path.
  32. $(call import-add-path,/out)
  33. # Import @<@PROJECT_NAME@>@ so we can depend on it.
  34. $(call import-module,prefab/@<@PROJECT_NAME@>@)
  35. ```
  36. ---
  37. ## Other build systems (advanced)
  38. If you want to build a project without Gradle,
  39. running the following command will extract the Android archive into a more common directory structure.
  40. ```
  41. python @<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar -o android_prefix
  42. ```
  43. Add `--help` for a list of all available options.
  44. # Documentation
  45. An API reference, tutorials, and additional documentation is available at:
  46. https://wiki.libsdl.org/SDL3
  47. # Example code
  48. There are simple example programs available at:
  49. https://examples.libsdl.org/SDL3
  50. # Discussions
  51. ## Discord
  52. You can join the official Discord server at:
  53. https://discord.com/invite/BwpFGBWsv8
  54. ## Forums/mailing lists
  55. You can join SDL development discussions at:
  56. https://discourse.libsdl.org/
  57. Once you sign up, you can use the forum through the website or as a mailing list from your email client.
  58. ## Announcement list
  59. You can sign up for the low traffic announcement list at:
  60. https://www.libsdl.org/mailing-list.php