Files
kichikuou_system3-sdl2/android/app/jni/CMakeLists.txt
T
kichikuou 981c302dfc Migrate Android from SDL2 to SDL3
Make SDL3 the default and only supported SDL version for Android. Download
the official SDL3 Android AAR during Gradle configuration and expose it to
the native CMake build through Prefab. SDL_ttf 3 is built from source with
HarfBuzz and PlutoSVG disabled.
2026-09-16 09:24:40 +09:00

32 lines
1.4 KiB
CMake

cmake_minimum_required(VERSION 3.14)
project(GAME)
set(PROJECT_ROOT_DIR ../../..)
find_package(SDL3 REQUIRED CONFIG)
include(FetchContent)
set(SDLTTF_VENDORED ON CACHE BOOL "Use vendored third-party libraries" FORCE)
set(SDLTTF_HARFBUZZ OFF CACHE BOOL "Use harfbuzz to improve text shaping" FORCE)
set(SDLTTF_PLUTOSVG OFF CACHE BOOL "Enable plutosvg for color SVG fonts" FORCE)
set(SDLTTF_SAMPLES OFF CACHE BOOL "Build the SDL3_ttf sample program(s)" FORCE)
set(SDLTTF_INSTALL OFF CACHE BOOL "Enable SDL3_ttf install target" FORCE)
FetchContent_Declare(SDL_ttf
GIT_REPOSITORY https://github.com/libsdl-org/SDL_ttf.git
GIT_TAG release-3.2.2
GIT_SHALLOW TRUE
GIT_SUBMODULES external/freetype)
FetchContent_MakeAvailable(SDL_ttf)
# The main CMakeLists.txt of system3
add_subdirectory(${PROJECT_ROOT_DIR} src)
# Copy license files into the assets directory so they can be shown in-app.
set(ASSETS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src/main/assets)
file(MAKE_DIRECTORY ${ASSETS_DIR}/licenses)
file(COPY_FILE ${PROJECT_ROOT_DIR}/COPYING.txt ${ASSETS_DIR}/licenses/system3)
file(COPY_FILE ${PROJECT_ROOT_DIR}/resources/fonts/MTLc3m.ttf.license ${ASSETS_DIR}/licenses/MTLc3m)
file(COPY_FILE ${PROJECT_ROOT_DIR}/deps/ymfm/LICENSE ${ASSETS_DIR}/licenses/ymfm)
file(COPY_FILE ${sdl_ttf_SOURCE_DIR}/LICENSE.txt ${ASSETS_DIR}/licenses/SDL_ttf)
file(COPY_FILE ${sdl_ttf_SOURCE_DIR}/external/freetype/docs/GPLv2.TXT ${ASSETS_DIR}/licenses/freetype)