-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCMake-Android.cmake
More file actions
29 lines (25 loc) · 995 Bytes
/
Copy pathCMake-Android.cmake
File metadata and controls
29 lines (25 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
macro(add_android_sources TARGET_NAME)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -frtti")
find_library(ANDROID_LOG_LIB log)
find_library(ANDROID_LIB android)
find_library(ANDROID_GLESv3_LIB GLESv3)
find_library(ANDROID_EGL_LIB EGL)
set(ANDROID_SOURCE_FILES src/platform/Android/sdk/src/main/cpp/*.cpp)
file(GLOB Android_FILES ${ANDROID_SOURCE_FILES})
target_sources(${TARGET_NAME} PUBLIC ${Android_FILES})
target_include_directories(${TARGET_NAME} PRIVATE src/platform/Android/sdk/src/main/cpp/)
target_include_directories(${TARGET_NAME} PUBLIC ${ANDROID_NDK_ROOT}/sources/android/native_app_glue)
target_compile_definitions(${TARGET_NAME}
PUBLIC
ANDROID_PLATFORM
__ANDROID__
SLARK_ANDROID
)
target_link_libraries(${TARGET_NAME}
PUBLIC
${ANDROID_LOG_LIB}
${ANDROID_LIB}
${ANDROID_GLESv3_LIB}
${ANDROID_EGL_LIB}
)
endmacro()