mirror of
https://github.com/ZDoom/ZMusic.git
synced 2024-11-23 12:22:30 +00:00
Fix compressed format support on GME when using miniz
This commit is contained in:
parent
33de9d93fc
commit
26c889088d
4 changed files with 17 additions and 11 deletions
2
thirdparty/CMakeLists.txt
vendored
2
thirdparty/CMakeLists.txt
vendored
|
@ -1,3 +1,4 @@
|
|||
add_subdirectory(miniz)
|
||||
# GME is not currently released in a way that's conducive to using as a system
|
||||
# library. Nevertheless at least one person tried, and so the ability to use a
|
||||
# system copy exists soley to placate people following distro guidelines to the
|
||||
|
@ -19,7 +20,6 @@
|
|||
add_subdirectory(game-music-emu)
|
||||
#endif()
|
||||
|
||||
add_subdirectory(miniz)
|
||||
add_subdirectory(dumb)
|
||||
add_subdirectory(adlmidi)
|
||||
add_subdirectory(opnmidi)
|
||||
|
|
20
thirdparty/game-music-emu/gme/CMakeLists.txt
vendored
20
thirdparty/game-music-emu/gme/CMakeLists.txt
vendored
|
@ -21,7 +21,8 @@ if(NOT BUILD_SHARED_LIBS)
|
|||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
endif()
|
||||
|
||||
find_package(ZLIB QUIET)
|
||||
# [ZMusic] We use miniz now.
|
||||
# find_package(ZLIB QUIET)
|
||||
|
||||
# Ay_Apu is very popular around here
|
||||
if (USE_GME_AY OR USE_GME_KSS)
|
||||
|
@ -165,17 +166,20 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|||
# Add library to be compiled.
|
||||
add_library(gme OBJECT ${libgme_SRCS})
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
message(" ** ZLib library located, compressed file formats will be supported")
|
||||
# Commented our since we use miniz
|
||||
#if(ZLIB_FOUND)
|
||||
# message(" ** ZLib library located, compressed file formats will be supported")
|
||||
target_compile_definitions(gme PRIVATE -DHAVE_ZLIB_H)
|
||||
target_link_libraries(gme PRIVATE miniz)
|
||||
|
||||
# [ZMusic] Switch to modern target for better transitive handling.
|
||||
target_link_libraries(gme PRIVATE ZLIB::ZLIB)
|
||||
# target_link_libraries(gme PRIVATE ZLIB::ZLIB)
|
||||
# Is not to be installed though
|
||||
|
||||
set(PKG_CONFIG_ZLIB -lz) # evaluated in libgme.pc.in
|
||||
else()
|
||||
message("ZLib library not found, disabling support for compressed formats such as VGZ")
|
||||
endif()
|
||||
# set(PKG_CONFIG_ZLIB -lz) # evaluated in libgme.pc.in
|
||||
#else()
|
||||
# message("ZLib library not found, disabling support for compressed formats such as VGZ")
|
||||
#endif()
|
||||
|
||||
# [ZMusic] Interface include directories
|
||||
target_include_directories(gme INTERFACE ..)
|
||||
|
|
|
@ -21,7 +21,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
|||
#include "blargg_source.h"
|
||||
|
||||
#ifdef HAVE_ZLIB_H
|
||||
#include <zlib.h>
|
||||
// [ZMusic] Use miniz.
|
||||
#include <miniz.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
static const unsigned char gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
|
||||
|
|
3
thirdparty/game-music-emu/gme/Data_Reader.h
vendored
3
thirdparty/game-music-emu/gme/Data_Reader.h
vendored
|
@ -7,7 +7,8 @@
|
|||
#include "blargg_common.h"
|
||||
|
||||
#ifdef HAVE_ZLIB_H
|
||||
#include <zlib.h>
|
||||
// [ZMusic] Use miniz.
|
||||
#include <miniz.h>
|
||||
#endif
|
||||
|
||||
// Supports reading and finding out how many bytes are remaining
|
||||
|
|
Loading…
Reference in a new issue