kaliber/build/android/app/CMakeLists.txt

171 lines
7.8 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.22.1)
2020-04-13 11:24:53 +00:00
# common_config
add_library(common_config INTERFACE)
target_compile_options(common_config INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:-std=c++20>
#$<$<NOT:$<CONFIG:DEBUG>>:-Ofast>
-Wall
-Werror
-Wno-unused-but-set-variable
-Wno-deprecated-enum-enum-conversion
-Wno-unsequenced
-Wno-nullability-completeness
)
target_compile_definitions(common_config INTERFACE
VK_USE_PLATFORM_ANDROID_KHR
VMA_STATIC_VULKAN_FUNCTIONS=1
$<$<CONFIG:DEBUG>:_DEBUG>
)
target_include_directories(common_config INTERFACE
../../../src
../../../src/third_party/glslang
../../../src/third_party/vulkan/include
)
# oboe
2020-04-13 11:24:53 +00:00
set (OBOE_DIR ../../../src/third_party/oboe)
add_subdirectory(${OBOE_DIR} ./oboe-bin)
# cpufeatures
add_library(cpufeatures STATIC ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
target_include_directories(cpufeatures PUBLIC ${ANDROID_NDK}/sources/android/cpufeatures)
2020-04-13 11:24:53 +00:00
# native_app_glue
add_library(native_app_glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
target_include_directories(native_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue)
set_property(TARGET native_app_glue PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-13 11:24:53 +00:00
# Export ANativeActivity_onCreate(),
# Refer to: https://github.com/android-ndk/ndk/issues/381.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
# kaliber
project(kaliber)
2020-04-13 11:24:53 +00:00
add_library(kaliber SHARED
2020-04-13 11:24:53 +00:00
../../../src/base/collusion_test.cc
../../../src/base/log.cc
../../../src/base/sinc_resampler.cc
2020-04-13 11:24:53 +00:00
../../../src/base/task_runner.cc
../../../src/base/thread_pool.cc
2020-04-13 11:24:53 +00:00
../../../src/base/timer.cc
../../../src/demo/credits.cc
../../../src/demo/demo.cc
../../../src/demo/enemy.cc
../../../src/demo/hud.cc
../../../src/demo/menu.cc
../../../src/demo/player.cc
../../../src/demo/sky_quad.cc
../../../src/engine/animatable.cc
../../../src/engine/animator.cc
2023-05-17 23:17:31 +00:00
../../../src/engine/audio/audio_mixer.cc
2023-05-23 02:18:01 +00:00
../../../src/engine/audio/audio_sink_oboe.cc
../../../src/engine/drawable.cc
2020-04-13 11:24:53 +00:00
../../../src/engine/engine.cc
../../../src/engine/font.cc
../../../src/engine/image_quad.cc
../../../src/engine/image.cc
../../../src/engine/mesh.cc
../../../src/engine/persistent_data.cc
2020-04-13 11:24:53 +00:00
../../../src/engine/platform/asset_file_android.cc
../../../src/engine/platform/asset_file.cc
../../../src/engine/platform/platform_android.cc
../../../src/engine/renderer/geometry.cc
../../../src/engine/renderer/opengl/render_command.cc
../../../src/engine/renderer/opengl/renderer_opengl_android.cc
../../../src/engine/renderer/opengl/renderer_opengl.cc
2020-04-13 11:24:53 +00:00
../../../src/engine/renderer/renderer_types.cc
../../../src/engine/renderer/shader.cc
../../../src/engine/renderer/texture.cc
2020-12-24 23:22:41 +00:00
../../../src/engine/renderer/vulkan/renderer_vulkan_android.cc
../../../src/engine/renderer/vulkan/renderer_vulkan.cc
../../../src/engine/renderer/vulkan/vulkan_context_android.cc
../../../src/engine/renderer/vulkan/vulkan_context.cc
2020-04-13 11:24:53 +00:00
../../../src/engine/shader_source.cc
../../../src/engine/solid_quad.cc
../../../src/engine/sound_player.cc
../../../src/engine/sound.cc
../../../src/third_party/android/gl3stub.c
../../../src/third_party/android/GLContext.cpp
2020-12-24 23:22:41 +00:00
../../../src/third_party/glslang/glslang/GenericCodeGen/CodeGen.cpp
../../../src/third_party/glslang/glslang/GenericCodeGen/Link.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/attribute.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/Constant.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/glslang_tab.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/InfoSink.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/Initialize.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/Intermediate.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/intermOut.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/IntermTraverse.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/iomapper.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/limits.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/linkValidate.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/parseConst.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/ParseContextBase.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/ParseHelper.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/PoolAlloc.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/propagateNoContraction.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/reflection.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/RemoveTree.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/Scan.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/ShaderLang.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
2020-12-24 23:22:41 +00:00
../../../src/third_party/glslang/glslang/MachineIndependent/SymbolTable.cpp
../../../src/third_party/glslang/glslang/MachineIndependent/Versions.cpp
../../../src/third_party/glslang/glslang/OSDependent/Unix/ossource.cpp
../../../src/third_party/glslang/OGLCompilersDLL/InitializeDll.cpp
../../../src/third_party/glslang/SPIRV/disassemble.cpp
../../../src/third_party/glslang/SPIRV/doc.cpp
../../../src/third_party/glslang/SPIRV/GlslangToSpv.cpp
../../../src/third_party/glslang/SPIRV/InReadableOrder.cpp
../../../src/third_party/glslang/SPIRV/Logger.cpp
../../../src/third_party/glslang/SPIRV/SpvBuilder.cpp
../../../src/third_party/glslang/SPIRV/SpvPostProcess.cpp
../../../src/third_party/glslang/SPIRV/SPVRemapper.cpp
../../../src/third_party/glslang/SPIRV/SpvTools.cpp
2022-11-10 20:39:24 +00:00
../../../src/third_party/jsoncpp/jsoncpp.cpp
2020-04-13 11:24:53 +00:00
../../../src/third_party/minizip/ioapi.c
../../../src/third_party/minizip/unzip.c
2020-12-24 23:22:41 +00:00
../../../src/third_party/spirv-reflect/spirv_reflect.c
../../../src/third_party/stb/stb_image.c
2020-04-13 11:24:53 +00:00
../../../src/third_party/texture_compressor/dxt_encoder_internals.cc
../../../src/third_party/texture_compressor/dxt_encoder.cc
../../../src/third_party/texture_compressor/texture_compressor_etc1.cc
../../../src/third_party/texture_compressor/texture_compressor.cc
2020-12-24 23:22:41 +00:00
../../../src/third_party/vma/vk_mem_alloc.cpp
../../../src/third_party/volk/volk.c
2020-04-13 11:24:53 +00:00
)
if (ANDROID_ABI STREQUAL armeabi-v7a)
target_sources(kaliber PRIVATE ../../../src/third_party/texture_compressor/dxt_encoder_neon.cc)
target_sources(kaliber PRIVATE ../../../src/third_party/texture_compressor/texture_compressor_etc1_neon.cc)
2020-04-13 11:24:53 +00:00
set_source_files_properties(../../../src/third_party/texture_compressor/dxt_encoder_neon.cc PROPERTIES COMPILE_FLAGS -mfpu=neon)
set_source_files_properties(../../../src/third_party/texture_compressor/texture_compressor_etc1_neon.cc PROPERTIES COMPILE_FLAGS -mfpu=neon)
endif()
if (ANDROID_ABI STREQUAL arm64-v8a)
target_sources(kaliber PRIVATE ../../../src/third_party/texture_compressor/dxt_encoder_neon.cc)
target_sources(kaliber PRIVATE ../../../src/third_party/texture_compressor/texture_compressor_etc1_neon.cc)
2020-04-13 11:24:53 +00:00
endif()
target_link_libraries(kaliber PRIVATE
common_config
2020-04-13 11:24:53 +00:00
android
native_app_glue
oboe
cpufeatures
EGL
GLESv2
log
z
)