lua-modules-readme.txt 2.2 KB

123456789101112131415161718192021222324252627282930
  1. This folder should contain external Lua C modules that will be shipped along with LOVE. One for each folder
  2. Each folder must contains:
  3. * Either CMakeLists.txt or Android.mk.
  4. * If Android.mk is present:
  5. The Android.mk will be converted to CMakeLists.txt. This conversion may not 100% perfect!
  6. The LOCAL_MODULE_FILENAME must be set accordingly as ndk-build appends "lib" prefix from LOCAL_MODULE by default.
  7. For Lua includes and libraries, simply link the native library with "liblove".
  8. Note: This will convert Android.mk to CMakeLists.txt. The conversion may not 100% perfect. Conditionals are not
  9. parsed and treated as if all codepaths are taken. Modify the generated CMakeLists.txt if necessary!
  10. Caveat: If the library is meant to be loaded as require("my.library") then you MUST set LOCAL_MODULE_FILENAME to
  11. my.library (with dots).
  12. * If CMakeLists.txt is present:
  13. The CMake script is loaded directly.
  14. For Lua includes and libraries, link with "luajit" target.
  15. Caveat: If the library is meant to be loaded as require("my.library") then you MUST set OUTPUT_NAME property to
  16. "my.library" (with dots) and PREFIX property to "" (empty string) on your CMake target using
  17. "set_target_properties".
  18. * If your module interacts with Java-side, a file java.txt must contain where it should look Java source files.
  19. Example, if you have src/java/your/package/name/MyFile.java, then you need to write "src/java" in java.txt.
  20. If this file is absent, then your Java-side code will not be compiled along.
  21. Note: There's bug in Android CMake support which prevents inclusion of imported *.so.
  22. More information about it here: https://issuetracker.google.com/issues/274493986
  23. In short:
  24. * If your library is simply an imported target (or prebuilt in ndk-build terms), convert it to standard target.
  25. Otherwise the associated *.so won't be bundled into the APK!
  26. * If your library depends on imported/prebuilt target, you must add your CMake target to the `app/build.gradle`
  27. as part of the targets that need to be compiled. Add your CMake target at
  28. `android.defaultConfig.externalNativeBuild.cmake.targets` property.