60 lines
1.4 KiB
CMake
60 lines
1.4 KiB
CMake
# Sets the minimum version of CMake required to build your native library.
|
|
# This ensures that a certain set of CMake features is available to
|
|
# your build.
|
|
|
|
cmake_minimum_required(VERSION 3.4.1)
|
|
|
|
# build native_app_glue as a static lib
|
|
add_library(
|
|
app-glue STATIC
|
|
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c
|
|
)
|
|
|
|
# Specifies a library name, specifies whether the library is STATIC or
|
|
# SHARED, and provides relative paths to the source code. You can
|
|
# define multiple libraries by adding multiple add.library() commands,
|
|
# and CMake builds them for you. When you build your app, Gradle
|
|
# automatically packages shared libraries with your APK.
|
|
|
|
# now build app's shared lib
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
|
|
|
|
add_library(
|
|
native-lib SHARED
|
|
../libs/yoga/yoga/YGNodeList.c
|
|
../libs/yoga/yoga/Yoga.c
|
|
../libs/tinyxml2/tinyxml2.cpp
|
|
src/main/cpp/main.cpp
|
|
../engine/pch.cpp
|
|
../engine/util.cpp
|
|
../engine/rtt.cpp
|
|
../engine/bezier.cpp
|
|
../engine/asset.cpp
|
|
../engine/image.cpp
|
|
../engine/texture.cpp
|
|
../engine/font.cpp
|
|
../engine/shader.cpp
|
|
../engine/shape.cpp
|
|
../engine/layout.cpp
|
|
../engine/app.cpp
|
|
)
|
|
|
|
target_include_directories(native-lib PRIVATE
|
|
${ANDROID_NDK}/sources/android/native_app_glue
|
|
../engine
|
|
../libs/glm
|
|
../libs/tinyxml2
|
|
../libs/yoga
|
|
../libs/stb
|
|
)
|
|
|
|
# add lib dependencies
|
|
target_link_libraries(
|
|
native-lib
|
|
android
|
|
app-glue
|
|
EGL
|
|
GLESv3
|
|
log
|
|
)
|