Android gradle build files (triangle)
This commit is contained in:
parent
2d48a76138
commit
3cde83945e
13 changed files with 508 additions and 0 deletions
37
android/examples/triangle/CMakeLists.txt
Normal file
37
android/examples/triangle/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
cmake_minimum_required(VERSION 3.4.1 FATAL_ERROR)
|
||||
|
||||
set(NAME triangle)
|
||||
|
||||
set(SRC_DIR ../../../examples/${NAME})
|
||||
set(BASE_DIR ../../../base)
|
||||
set(EXTERNAL_DIR ../../../external)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
|
||||
|
||||
file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
|
||||
file(GLOB BASE_SRC "${BASE_DIR}/*.cpp")
|
||||
|
||||
add_library(
|
||||
native-lib SHARED
|
||||
${EXAMPLE_SRC}
|
||||
${BASE_SRC}
|
||||
${EXTERNAL_DIR}/imgui/imgui.cpp
|
||||
${EXTERNAL_DIR}/imgui/imgui_draw.cpp
|
||||
)
|
||||
|
||||
add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
|
||||
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
|
||||
|
||||
include_directories(${BASE_DIR})
|
||||
include_directories(${EXTERNAL_DIR}/glm)
|
||||
include_directories(${EXTERNAL_DIR}/gli)
|
||||
include_directories(${EXTERNAL_DIR}/imgui)
|
||||
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
||||
|
||||
target_link_libraries(
|
||||
native-lib
|
||||
native-app-glue
|
||||
android
|
||||
log
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue