mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-23 10:36:24 +00:00
Fixed bug 3918 - CMake support for android project
This commit is contained in:
@@ -22,6 +22,11 @@ android {
|
||||
arguments "APP_PLATFORM=android-16"
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||
}
|
||||
// cmake {
|
||||
// arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
|
||||
// // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||
// abiFilters 'arm64-v8a'
|
||||
// }
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
@@ -38,6 +43,9 @@ android {
|
||||
ndkBuild {
|
||||
path 'jni/Android.mk'
|
||||
}
|
||||
// cmake {
|
||||
// path 'jni/CMakeLists.txt'
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
18
android-project/app/jni/CMakeLists.txt
Normal file
18
android-project/app/jni/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
|
||||
project(GAME)
|
||||
|
||||
# Settings
|
||||
set(HIDAPI OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# armeabi-v7a requires cpufeatures library
|
||||
# include(AndroidNdkModules)
|
||||
# android_ndk_import_module_cpufeatures()
|
||||
|
||||
|
||||
# SDL sources are in a subfolder named "SDL"
|
||||
add_subdirectory(SDL)
|
||||
|
||||
# Your game and its CMakeLists.txt are in a subfolder named "src"
|
||||
add_subdirectory(src)
|
||||
|
||||
13
android-project/app/jni/src/CMakeLists.txt
Normal file
13
android-project/app/jni/src/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
|
||||
project(MY_APP)
|
||||
|
||||
find_library(SDL2 SDL2)
|
||||
|
||||
add_library(main SHARED)
|
||||
|
||||
target_sources(main PRIVATE YourSourceHere.c)
|
||||
|
||||
target_link_libraries(main SDL2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user