added music
This commit is contained in:
1 parent
a1dda3fd50
commit
b5bcd3a812
9 files changed
+306
-92
No files matched your search
+119
-1
@@ -607,4 +607,122 @@ if(NOT TARGET sol2_external_lib)
|
||||
add_library(sol2_external_lib INTERFACE)
|
||||
target_include_directories(sol2_external_lib INTERFACE "${SOL2_SRC_DIR}/include")
|
||||
target_link_libraries(sol2_external_lib INTERFACE lua_static)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ===========================================
|
||||
# 11) SDL2_mixer (2.8.0) – сборка из исходников
|
||||
# ===========================================
|
||||
set(SDL2MIXER_SRC_DIR "${THIRDPARTY_DIR}/SDL_mixer-release-2.8.0")
|
||||
set(SDL2MIXER_BASE_DIR "${SDL2MIXER_SRC_DIR}/install")
|
||||
set(SDL2MIXER_BASE_DIR "${SDL2MIXER_BASE_DIR}" CACHE PATH "SDL2_mixer install base directory" FORCE)
|
||||
|
||||
set(_have_sdl2mixer TRUE)
|
||||
foreach(cfg IN LISTS BUILD_CONFIGS)
|
||||
if(NOT EXISTS "${SDL2MIXER_BASE_DIR}-${cfg}/lib/SDL2_mixer.lib" AND
|
||||
NOT EXISTS "${SDL2MIXER_BASE_DIR}-${cfg}/lib/SDL2_mixerd.lib")
|
||||
set(_have_sdl2mixer FALSE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT _have_sdl2mixer)
|
||||
foreach(cfg IN LISTS BUILD_CONFIGS)
|
||||
if(cfg STREQUAL "Debug")
|
||||
set(_SDL2_LIB "${SDL2_INSTALL_DIR}/lib/SDL2d.lib")
|
||||
else()
|
||||
set(_SDL2_LIB "${SDL2_INSTALL_DIR}/lib/SDL2.lib")
|
||||
endif()
|
||||
|
||||
log("Configuring SDL2_mixer (${cfg}) ...")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-G "${CMAKE_GENERATOR}"
|
||||
-S "${SDL2MIXER_SRC_DIR}"
|
||||
-B "${SDL2MIXER_SRC_DIR}/build-${cfg}"
|
||||
-DCMAKE_INSTALL_PREFIX=${SDL2MIXER_BASE_DIR}-${cfg}
|
||||
-DCMAKE_PREFIX_PATH=${SDL2_INSTALL_DIR}
|
||||
-DSDL2_LIBRARY=${_SDL2_LIB}
|
||||
-DSDL2_INCLUDE_DIR=${SDL2_INSTALL_DIR}/include/SDL2
|
||||
-DSDL2MIXER_DEPS_SHARED=OFF
|
||||
-DSDL2MIXER_VENDORED=ON
|
||||
-DSDL2MIXER_SAMPLES=OFF
|
||||
-DSDL2MIXER_MUSIC_CMD=OFF
|
||||
-DSDL2MIXER_MOD=OFF
|
||||
-DSDL2MIXER_MIDI=OFF
|
||||
-DSDL2MIXER_OPUS=OFF
|
||||
-DSDL2MIXER_WAVPACK=OFF
|
||||
-DSDL2MIXER_MP3_MPG123=OFF
|
||||
-DSDL2MIXER_MP3_DRMP3=ON
|
||||
-DSDL2MIXER_FLAC_DRFLAC=ON
|
||||
-DSDL2MIXER_OGG_STB=ON
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_OGG=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Vorbis=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_FLAC=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_MPG123=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_LibModPlug=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_FluidLite=TRUE
|
||||
RESULT_VARIABLE _mixer_cfg_res
|
||||
OUTPUT_VARIABLE _mixer_cfg_out
|
||||
ERROR_VARIABLE _mixer_cfg_err
|
||||
)
|
||||
if(NOT _mixer_cfg_res EQUAL 0)
|
||||
message(STATUS "SDL2_mixer configure stdout: ${_mixer_cfg_out}")
|
||||
message(STATUS "SDL2_mixer configure stderr: ${_mixer_cfg_err}")
|
||||
message(FATAL_ERROR "SDL2_mixer configure failed for ${cfg}")
|
||||
endif()
|
||||
|
||||
log("Building SDL2_mixer (${cfg}) ...")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
--build "${SDL2MIXER_SRC_DIR}/build-${cfg}" --config ${cfg}
|
||||
RESULT_VARIABLE _mixer_build_res
|
||||
)
|
||||
if(NOT _mixer_build_res EQUAL 0)
|
||||
message(FATAL_ERROR "SDL2_mixer build failed for ${cfg}")
|
||||
endif()
|
||||
|
||||
log("Installing SDL2_mixer (${cfg}) ...")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
--install "${SDL2MIXER_SRC_DIR}/build-${cfg}" --config ${cfg}
|
||||
RESULT_VARIABLE _mixer_inst_res
|
||||
)
|
||||
if(NOT _mixer_inst_res EQUAL 0)
|
||||
message(FATAL_ERROR "SDL2_mixer install failed for ${cfg}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(_mixer_debug_lib "")
|
||||
foreach(cand
|
||||
"${SDL2MIXER_BASE_DIR}-Debug/lib/SDL2_mixerd.lib"
|
||||
"${SDL2MIXER_BASE_DIR}-Debug/lib/SDL2_mixer.lib"
|
||||
)
|
||||
if(EXISTS "${cand}")
|
||||
set(_mixer_debug_lib "${cand}")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(_mixer_release_lib "")
|
||||
foreach(cand
|
||||
"${SDL2MIXER_BASE_DIR}-Release/lib/SDL2_mixer.lib"
|
||||
)
|
||||
if(EXISTS "${cand}")
|
||||
set(_mixer_release_lib "${cand}")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(_mixer_debug_lib STREQUAL "" OR _mixer_release_lib STREQUAL "")
|
||||
message(FATAL_ERROR "SDL2_mixer libs not found in ${SDL2MIXER_BASE_DIR}-Debug/Release")
|
||||
endif()
|
||||
|
||||
add_library(SDL2_mixer_external_lib UNKNOWN IMPORTED GLOBAL)
|
||||
set_target_properties(SDL2_mixer_external_lib PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${_mixer_debug_lib}"
|
||||
IMPORTED_LOCATION_RELEASE "${_mixer_release_lib}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
"$<IF:$<CONFIG:Debug>,${SDL2MIXER_BASE_DIR}-Debug/include,${SDL2MIXER_BASE_DIR}-Release/include>"
|
||||
INTERFACE_LINK_LIBRARIES
|
||||
"SDL2_external_lib"
|
||||
)
|
||||
Reference in new issue
Block a user