Navigation Menu

Skip to content

Commit

Permalink
Android: add compilation with cmake (see bug 3918)
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Aug 13, 2019
1 parent fa36e45 commit 9d93de3
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,57 @@
cmake_minimum_required(VERSION 3.0)
project(SDL_mixer C)


if (ANDROID)

# FIXME: there are missing CMakeLists.txt
option(SUPPORT_FLAC "Support loading FLAC music with libFLAC" OFF)
option(SUPPORT_OGG "Support loading OGG Vorbis music via Tremor" OFF)
option(SUPPORT_MP3_MPG123 "Support loading MP3 music via MPG123" OFF)
option(SUPPORT_MOD_MODPLUG "Support loading MOD music via modplug" OFF)
option(SUPPORT_MID_TIMIDITY "Support TiMidity" OFF)

add_library(SDL_mixer SHARED)

target_sources(SDL_mixer PRIVATE
effect_position.c effects_internal.c
effect_stereoreverse.c load_aiff.c load_voc.c mixer.c music.c
music_cmd.c music_flac.c music_fluidsynth.c music_mad.c
music_mikmod.c music_modplug.c music_mpg123.c music_nativemidi.c
music_ogg.c music_opus.c music_timidity.c music_wav.c)

if (SUPPORT_FLAC)
add_definitions(-DMUSIC_FLAC)
add_subdirectory(external/flac-1.3.2)
target_link_libraries(SDL_mixer PRIVATE libFLAC)
endif()

if (SUPPORT_OGG)
add_definitions(-DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>")
add_subdirectory(external/libogg-1.3.2)
add_subdirectory(external/libvorbisidec-1.2.1)
target_link_libraries(SDL_mixer PRIVATE ogg vorbisidec)
endif()

if (SUPPORT_MP3_MPG123)
add_definitions(-DMUSIC_MP3_MPG123)
add_subdirectory(external/mpg123-1.25.6)
target_link_libraries(SDL_mixer PRIVATE mpg123)
endif()

if (SUPPORT_MOD_MODPLUG)
add_definitions(-DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>")
add_subdirectory(external/libmodplug-0.8.9.0)
target_link_libraries(SDL_mixer PRIVATE modplug)
endif()

if (SUPPORT_MID_TIMIDITY)
add_definitions(-DMUSIC_MID_TIMIDITY)
add_subdirectory(timidity)
target_link_libraries(SDL_mixer PRIVATE timidity)
endif()

target_link_libraries(SDL_mixer PRIVATE SDL2)
else()

endif()

0 comments on commit 9d93de3

Please sign in to comment.