cmake_minimum_required(VERSION 3.22)
project(wolf2009_android_viewer LANGUAGES CXX)
add_library(wolf2009-viewer SHARED native/viewer.cpp native/TextureBinding.cpp native/PlayerSession.cpp ../src/wolf2009/Archive.cpp ../src/wolf2009/Geometry.cpp ../src/wolf2009/Material.cpp ../src/wolf2009/Dds.cpp ../src/wolf2009/ZipArchive.cpp ../src/wolf2009/Entities.cpp ../src/wolf2009/PlayerStart.cpp ../src/wolf2009/StaticCollision.cpp ../src/wolf2009/PlayerMove.cpp ../src/wolf2009/MapPhysics.cpp)
target_sources(wolf2009-viewer PRIVATE ../src/wolf2009/ConvexContact.cpp)
target_sources(wolf2009-viewer PRIVATE ../src/wolf2009/RiderMovement.cpp ../src/wolf2009/BrainGraph.cpp)
target_sources(wolf2009-viewer PRIVATE ../src/wolf2009/TrainArrival.cpp ../src/wolf2009/SkinCatalog.cpp)
target_sources(wolf2009-viewer PRIVATE ../src/wolf2009/DoorAnimation.cpp ../src/wolf2009/DoorModel.cpp ../src/wolf2009/GreeterAnimation.cpp ../src/wolf2009/TrainDoorSignal.cpp ../src/wolf2009/ScriptedVoice.cpp ../src/wolf2009/TrainStopScene.cpp ../src/wolf2009/StreamMounts.cpp ../src/wolf2009/DeclarationText.cpp)
target_include_directories(wolf2009-viewer PRIVATE ../src/wolf2009)
target_sources(wolf2009-viewer PRIVATE ../src/wolf2009/ModelPlacement.cpp ../src/wolf2009/MovingSupport.cpp ../src/wolf2009/LinearMover.cpp ../src/wolf2009/BrainStartup.cpp ../src/wolf2009/WagonScene.cpp)
target_compile_features(wolf2009-viewer PRIVATE cxx_std_11)
target_compile_options(wolf2009-viewer PRIVATE -Wall -Wextra)
target_link_options(wolf2009-viewer PRIVATE -Wl,-z,max-page-size=16384)
find_library(android_log log REQUIRED)
find_library(gles3 GLESv3 REQUIRED)
find_library(compression z REQUIRED)
target_link_libraries(wolf2009-viewer PRIVATE ${android_log} ${gles3} ${compression})
