Merge pull request #774 from wolfman2000/wolf-with-mp3-off
Improve and enhance WITH_MP3.
This commit is contained in:
@@ -31,6 +31,9 @@ option(WITH_NO_ROLC_TOMCRYPT "Build without the ROLC assembly instructions for t
|
|||||||
# Turn this option off to not use the GPL exclusive components.
|
# Turn this option off to not use the GPL exclusive components.
|
||||||
option(WITH_GPL_LIBS "Build with GPL libraries." ON)
|
option(WITH_GPL_LIBS "Build with GPL libraries." ON)
|
||||||
|
|
||||||
|
# Turn this option off to disable using MP3 files with the game.
|
||||||
|
option(WITH_MP3 "Build with MP3 Support." ON)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
option(WITH_MINIMAID "Build with Minimaid Lights Support." ON)
|
option(WITH_MINIMAID "Build with Minimaid Lights Support." ON)
|
||||||
elseif(LINUX)
|
elseif(LINUX)
|
||||||
@@ -43,7 +46,6 @@ elseif(LINUX)
|
|||||||
option(WITH_GLES2 "Build with OpenGL ES 2.0 Support." ON)
|
option(WITH_GLES2 "Build with OpenGL ES 2.0 Support." ON)
|
||||||
option(WITH_GTK2 "Build with GTK2 Support." ON)
|
option(WITH_GTK2 "Build with GTK2 Support." ON)
|
||||||
option(WITH_OGG "Build with OGG/Vorbis Support." ON)
|
option(WITH_OGG "Build with OGG/Vorbis Support." ON)
|
||||||
option(WITH_MP3 "Build with MP3 Support." ON)
|
|
||||||
option(WITH_PARALLEL_PORT "Build with Parallel Lights I/O Support." OFF)
|
option(WITH_PARALLEL_PORT "Build with Parallel Lights I/O Support." OFF)
|
||||||
option(WITH_CRASH_HANDLER "Build with Crash Handler Support." ON)
|
option(WITH_CRASH_HANDLER "Build with Crash Handler Support." ON)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+14
-13
@@ -131,13 +131,22 @@ if (WITH_VERSION_INFO)
|
|||||||
set(HAVE_VERSION_INFO 1)
|
set(HAVE_VERSION_INFO 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file("${SM_SRC_DIR}/config.in.hpp" "${SM_SRC_DIR}/generated/config.hpp")
|
|
||||||
|
|
||||||
# Dependencies go here.
|
# Dependencies go here.
|
||||||
|
if(WITH_MP3)
|
||||||
|
if(WIN32 OR MACOSX)
|
||||||
|
set(HAS_MP3 TRUE)
|
||||||
|
else()
|
||||||
|
find_package(Mad)
|
||||||
|
if(NOT LIBMAD_FOUND)
|
||||||
|
message(FATAL_ERROR "Libmad library not found. If you wish to skip mp3 support, set WITH_MP3 to OFF when configuring.")
|
||||||
|
else()
|
||||||
|
set(HAS_MP3 TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(HAS_OGG TRUE)
|
set(HAS_OGG TRUE)
|
||||||
set(HAS_MP3 TRUE)
|
|
||||||
set(SYSTEM_PCRE_FOUND FALSE)
|
set(SYSTEM_PCRE_FOUND FALSE)
|
||||||
find_package(DirectX REQUIRED)
|
find_package(DirectX REQUIRED)
|
||||||
|
|
||||||
@@ -163,7 +172,6 @@ if(WIN32)
|
|||||||
get_filename_component(LIB_AVUTIL ${LIB_AVUTIL} NAME)
|
get_filename_component(LIB_AVUTIL ${LIB_AVUTIL} NAME)
|
||||||
elseif(MACOSX)
|
elseif(MACOSX)
|
||||||
set(HAS_OGG TRUE)
|
set(HAS_OGG TRUE)
|
||||||
set(HAS_MP3 TRUE)
|
|
||||||
set(SYSTEM_PCRE_FOUND FALSE)
|
set(SYSTEM_PCRE_FOUND FALSE)
|
||||||
set(WITH_CRASH_HANDLER TRUE)
|
set(WITH_CRASH_HANDLER TRUE)
|
||||||
# Apple Archs needs to be 32-bit for now.
|
# Apple Archs needs to be 32-bit for now.
|
||||||
@@ -272,15 +280,6 @@ elseif(LINUX)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_MP3)
|
|
||||||
find_package(Mad)
|
|
||||||
if(NOT LIBMAD_FOUND)
|
|
||||||
message(FATAL_ERROR "Libmad library not found. If you wish to skip mp3 support, set WITH_MP3 to OFF when configuring.")
|
|
||||||
else()
|
|
||||||
set(HAS_MP3 TRUE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(PulseAudio)
|
find_package(PulseAudio)
|
||||||
if (PULSEAUDIO_FOUND)
|
if (PULSEAUDIO_FOUND)
|
||||||
set(HAS_PULSE TRUE)
|
set(HAS_PULSE TRUE)
|
||||||
@@ -410,5 +409,7 @@ elseif(LINUX)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
configure_file("${SM_SRC_DIR}/config.in.hpp" "${SM_SRC_DIR}/generated/config.hpp")
|
||||||
|
|
||||||
# Define installer based items for cpack.
|
# Define installer based items for cpack.
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/CMake/CPackSetup.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/CMake/CPackSetup.cmake")
|
||||||
|
|||||||
+12
-19
@@ -424,12 +424,20 @@ list(APPEND SMDATA_LINK_LIB
|
|||||||
"tommath"
|
"tommath"
|
||||||
"zlib"
|
"zlib"
|
||||||
"jsoncpp"
|
"jsoncpp"
|
||||||
"mad"
|
|
||||||
"png"
|
"png"
|
||||||
"glew"
|
"glew"
|
||||||
"jpeg"
|
"jpeg"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (HAS_MP3)
|
||||||
|
list(FIND SMDATA_LINK_LIB "jsoncpp" JSON_INDEX)
|
||||||
|
if (WIN32 OR MACOSX)
|
||||||
|
list(INSERT SMDATA_LINK_LIB ${JSON_INDEX} "mad")
|
||||||
|
else()
|
||||||
|
list(INSERT SMDATA_LINK_LIB ${JSON_INDEX} ${LIBMAD_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT SYSTEM_PCRE_FOUND)
|
if (NOT SYSTEM_PCRE_FOUND)
|
||||||
list(APPEND SMDATA_LINK_LIB "pcre")
|
list(APPEND SMDATA_LINK_LIB "pcre")
|
||||||
endif()
|
endif()
|
||||||
@@ -473,9 +481,7 @@ elseif(APPLE)
|
|||||||
# ${MAC_FRAME_FOUNDATION}
|
# ${MAC_FRAME_FOUNDATION}
|
||||||
# "ffmpeg"
|
# "ffmpeg"
|
||||||
|
|
||||||
# TODO: Adjust the target when StepMania-Data returns.
|
list(INSERT SMDATA_LINK_LIB 0
|
||||||
# TODO: Find a cleaner way besides just setting to wipe the slate clean.
|
|
||||||
set(SMDATA_LINK_LIB
|
|
||||||
${MAC_FRAME_ACCELERATE}
|
${MAC_FRAME_ACCELERATE}
|
||||||
${MAC_FRAME_CARBON}
|
${MAC_FRAME_CARBON}
|
||||||
${MAC_FRAME_COCOA}
|
${MAC_FRAME_COCOA}
|
||||||
@@ -490,16 +496,9 @@ elseif(APPLE)
|
|||||||
"ogg"
|
"ogg"
|
||||||
"theora"
|
"theora"
|
||||||
"vorbis"
|
"vorbis"
|
||||||
"lua-5.1"
|
)
|
||||||
"tomcrypt"
|
list(APPEND SMDATA_LINK_LIB
|
||||||
"tommath"
|
|
||||||
"zlib"
|
|
||||||
"jsoncpp"
|
|
||||||
"mad"
|
|
||||||
"png"
|
|
||||||
"glew"
|
|
||||||
"pcre"
|
"pcre"
|
||||||
"jpeg"
|
|
||||||
"avcodec"
|
"avcodec"
|
||||||
"avdevice"
|
"avdevice"
|
||||||
"avfilter"
|
"avfilter"
|
||||||
@@ -546,12 +545,6 @@ else() # Unix / Linux
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAS_MP3)
|
|
||||||
list(APPEND SMDATA_LINK_LIB
|
|
||||||
"${LIBMAD_LIBRARY}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
list(APPEND SMDATA_LINK_LIB
|
list(APPEND SMDATA_LINK_LIB
|
||||||
"${OPENGL_LIBRARY}"
|
"${OPENGL_LIBRARY}"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "RageSoundReader_WAV.h"
|
#include "RageSoundReader_WAV.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_MP3_SUPPORT
|
#if defined(HAS_MP3)
|
||||||
#include "RageSoundReader_MP3.h"
|
#include "RageSoundReader_MP3.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -25,7 +25,8 @@ RageSoundReader_FileReader *RageSoundReader_FileReader::TryOpenFile( RageFileBas
|
|||||||
if( !format.CompareNoCase("wav") )
|
if( !format.CompareNoCase("wav") )
|
||||||
Sample = new RageSoundReader_WAV;
|
Sample = new RageSoundReader_WAV;
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_MP3_SUPPORT
|
|
||||||
|
#if defined(HAS_MP3)
|
||||||
if( !format.CompareNoCase("mp3") )
|
if( !format.CompareNoCase("mp3") )
|
||||||
Sample = new RageSoundReader_MP3;
|
Sample = new RageSoundReader_MP3;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ typedef long ssize_t;
|
|||||||
/* Defined to 1 if version information will be printed out. */
|
/* Defined to 1 if version information will be printed out. */
|
||||||
#cmakedefine HAVE_VERSION_INFO 1
|
#cmakedefine HAVE_VERSION_INFO 1
|
||||||
|
|
||||||
|
/* Defined to 1 if compiling with MP3 support. */
|
||||||
|
#cmakedefine HAS_MP3 1
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
/** @brief Define a macro to tell the compiler that a function has printf()
|
/** @brief Define a macro to tell the compiler that a function has printf()
|
||||||
* semantics, to aid warning output. */
|
* semantics, to aid warning output. */
|
||||||
|
|||||||
Reference in New Issue
Block a user