From 793ef5db014cc8e4100e136b904b15bc7b23c0eb Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Mon, 15 Sep 2014 17:43:31 +0200 Subject: [PATCH] Apply foo0's patch to disable mpg123 in cmake megasource builds (issues #931 and #404) --- CMakeLists.txt | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff68c49f9..007b00087 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ else() endif() option(LOVE_JIT "Use LuaJIT" TRUE) +option(LOVE_MPG123 "Use mpg123" TRUE) if(LOVE_JIT) message(STATUS "LuaJIT: Enabled") @@ -53,6 +54,10 @@ else() message(STATUS "LuaJIT: Disabled") endif() +if(NOT LOVE_MPG123) + add_definitions(-DLOVE_NOMPG123) +endif() + message(STATUS "Target platform: ${LOVE_TARGET_PLATFORM}") find_package(OpenGL) @@ -610,8 +615,6 @@ set(LOVE_SRC_MODULE_SOUND_LULLABY src/modules/sound/lullaby/GmeDecoder.h src/modules/sound/lullaby/ModPlugDecoder.cpp src/modules/sound/lullaby/ModPlugDecoder.h - src/modules/sound/lullaby/Mpg123Decoder.cpp - src/modules/sound/lullaby/Mpg123Decoder.h src/modules/sound/lullaby/Sound.cpp src/modules/sound/lullaby/Sound.h src/modules/sound/lullaby/VorbisDecoder.cpp @@ -620,6 +623,14 @@ set(LOVE_SRC_MODULE_SOUND_LULLABY src/modules/sound/lullaby/WaveDecoder.h ) +if(LOVE_MPG123) + set(LOVE_SRC_MODULE_SOUND_LULLABY + ${LOVE_SRC_MODULE_SOUND_LULLABY} + src/modules/sound/lullaby/Mpg123Decoder.cpp + src/modules/sound/lullaby/Mpg123Decoder.h + ) +endif() + set(LOVE_SRC_MODULE_SOUND ${LOVE_SRC_MODULE_SOUND_ROOT} ${LOVE_SRC_MODULE_SOUND_LULLABY} @@ -1096,7 +1107,6 @@ set(LOVE_MEGA_3P ${MEGA_LIBVORBIS} ${MEGA_LUA} ${MEGA_MODPLUG} - ${MEGA_MPEG123} ${MEGA_OPENAL} ${MEGA_PHYSFS} ${MEGA_SDL2MAIN} @@ -1105,6 +1115,14 @@ set(LOVE_MEGA_3P ${MEGA_ZLIB} ) +if(LOVE_MPG123) + set(LOVE_MEGA_3P + ${LOVE_MEGA_3P} + ${MEGA_MPEG123} + ) +endif() + + set(LOVE_LINK_LIBRARIES ${OPENGL_gl_LIBRARY} ${LOVE_MEGA_3P} @@ -1144,7 +1162,10 @@ target_link_libraries(love liblove) # Add post build steps to move the DLLs next to the binary. Otherwise # running/debugging the binary will not work from inside VS. -add_move_dll(love ${MEGA_MPEG123}) +if(LOVE_MPG123) + add_move_dll(love ${MEGA_MPEG123}) +endif() + add_move_dll(love ${MEGA_SDL2}) add_move_dll(love ${MEGA_OPENAL}) add_move_dll(love ${MEGA_DEVIL})