From d2af8b83e06019ed28b68ec311fcffc3c863433d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 4 Nov 2020 18:27:53 -0800 Subject: [PATCH] CMake: Fix build with downstream minizip that exports incompatible symbols --- CHANGES | 1 + CMakeLists.txt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 83a1829ec..74383caa4 100644 --- a/CHANGES +++ b/CHANGES @@ -45,6 +45,7 @@ Emulation fixes: Other fixes: - 3DS: Fix thread cleanup - All: Improve export headers (fixes mgba.io/i/1738) + - CMake: Fix build with downstream minizip that exports incompatible symbols - Core: Ensure ELF regions can be written before trying - Debugger: Don't skip undefined instructions when debugger attached - FFmpeg: Fix some small memory leaks diff --git a/CMakeLists.txt b/CMakeLists.txt index af0426b8d..d230ed44a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -664,6 +664,12 @@ elseif(USE_MINIZIP) list(APPEND FEATURES MINIZIP) list(APPEND VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-zip.c) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libminizip1") + set(CMAKE_REQUIRED_LIBRARIES ${MINIZIP_LIBRARIES}) + check_function_exists(unztell64 HAVE_UNZTELL64) + unset(CMAKE_REQUIRED_LIBRARIES) + if(NOT HAVE_UNZTELL64) + add_definitions(-Dunztell64=unzTell64) # Bug in downstream minizip that some distros use + endif() elseif(USE_ZLIB) list(APPEND VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-zip.c ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/zlib/contrib/minizip/ioapi.c