diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/android-project/app/jni/src/CMakeLists.txt | |
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/android-project/app/jni/src/CMakeLists.txt')
| -rw-r--r-- | contrib/SDL-3.2.8/android-project/app/jni/src/CMakeLists.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/android-project/app/jni/src/CMakeLists.txt b/contrib/SDL-3.2.8/android-project/app/jni/src/CMakeLists.txt new file mode 100644 index 0000000..41a82f2 --- /dev/null +++ b/contrib/SDL-3.2.8/android-project/app/jni/src/CMakeLists.txt | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | cmake_minimum_required(VERSION 3.6) | ||
| 2 | |||
| 3 | project(my_app) | ||
| 4 | |||
| 5 | if(NOT TARGET SDL3::SDL3) | ||
| 6 | find_package(SDL3 CONFIG) | ||
| 7 | endif() | ||
| 8 | |||
| 9 | if(NOT TARGET SDL3::SDL3) | ||
| 10 | find_library(SDL3_LIBRARY NAMES "SDL3") | ||
| 11 | find_path(SDL3_INCLUDE_DIR NAMES "SDL3/SDL.h") | ||
| 12 | add_library(SDL3::SDL3 UNKNOWN IMPORTED) | ||
| 13 | set_property(TARGET SDL3::SDL3 PROPERTY IMPORTED_LOCATION "${SDL3_LIBRARY}") | ||
| 14 | set_property(TARGET SDL3::SDL3 PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIR}") | ||
| 15 | endif() | ||
| 16 | |||
| 17 | if(NOT TARGET SDL3::SDL3) | ||
| 18 | message(FATAL_ERROR "Cannot find SDL3. | ||
| 19 | |||
| 20 | Possible ways to fix this: | ||
| 21 | - Use a SDL3 Android aar archive, and configure gradle to use it: prefab is required. | ||
| 22 | - Add add_subdirectory(path/to/SDL) to your CMake script, and make sure a vendored SDL is present there. | ||
| 23 | ") | ||
| 24 | endif() | ||
| 25 | |||
| 26 | add_library(main SHARED | ||
| 27 | YourSourceHere.c | ||
| 28 | ) | ||
| 29 | target_link_libraries(main PRIVATE SDL3::SDL3) | ||
