mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-11 08:48:11 +03:00
- MP3/OGG files are now decoded with dr_mp3 and stb_vorbis via the new MakoMusic backend. - Merge src/win/mako.cpp into src/generic/mako.cpp: Windows now uses the same SDL audio path. - A single SDL2 audio device mixes FM, BGM and PCM in its callback with SDL_MixAudioFormat. - PCM plays through SDL_AudioStream. - dr_mp3 and stb_vorbis are vendored under deps/ and included from mako_music.cpp. Warnings for that translation unit are silenced.
38 lines
1.6 KiB
CMake
38 lines
1.6 KiB
CMake
cmake_minimum_required(VERSION 3.14)
|
|
|
|
project(GAME)
|
|
set(PROJECT_ROOT_DIR ../../..)
|
|
|
|
# Compilation of SDL and companion libraries
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
SDL
|
|
URL https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-2.32.10.tar.gz
|
|
URL_HASH SHA1=ce98fa93e31836a751feca374ab28a0770b63c16
|
|
)
|
|
FetchContent_Declare(
|
|
SDL_ttf
|
|
URL https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-2.22.0.tar.gz
|
|
URL_HASH SHA1=da5e86b601ad299a697878fab1af6f3be47b529d
|
|
)
|
|
set(SDL2TTF_SAMPLES OFF CACHE BOOL "Build the SDL2_ttf sample program(s)" FORCE)
|
|
set(SDL2TTF_INSTALL OFF CACHE BOOL "Enable SDL2_ttf install target" FORCE)
|
|
set(SDL2TTF_VENDORED ON CACHE BOOL "Use vendored third-party libraries" FORCE)
|
|
|
|
FetchContent_MakeAvailable(SDL)
|
|
FetchContent_MakeAvailable(SDL_ttf)
|
|
|
|
# The main CMakeLists.txt of system3
|
|
add_subdirectory(${PROJECT_ROOT_DIR} src)
|
|
|
|
# Copy asset files
|
|
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_SOURCE_DIR}/LICENSE.txt ${ASSETS_DIR}/licenses/SDL)
|
|
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)
|
|
file(COPY_FILE ${sdl_ttf_SOURCE_DIR}/external/harfbuzz/COPYING ${ASSETS_DIR}/licenses/harfbuzz)
|