all repos — mgba @ 9295c3c893646713d8fce7f9d15be320787b9d97

mGBA Game Boy Advance Emulator

CMake: Fix build with libzip 1.7
Vicki Pfau vi@endrift.com
Sun, 12 Jul 2020 00:21:42 -0700
commit

9295c3c893646713d8fce7f9d15be320787b9d97

parent

73c38b95b6be95ab9c58369fe7186fc197e1255e

2 files changed, 9 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -30,6 +30,7 @@ Other fixes:

- All: Improve export headers (fixes mgba.io/i/1738) - All: Correct format strings for some numbers on Windows (fixes mgba.io/i/1794) - All: Correct more format strings on Windows (fixes mgba.io/i/1817) + - CMake: Fix build with libzip 1.7 - Core: Ensure ELF regions can be written before trying - Debugger: Don't skip undefined instructions when debugger attached - FFmpeg: Fix some small memory leaks
M CMakeLists.txtCMakeLists.txt

@@ -631,15 +631,19 @@ set(USE_SQLITE3 ON)

endif() if(USE_LIBZIP) - include_directories(AFTER ${LIBZIP_INCLUDE_DIRS}) - link_directories(${LIBZIP_LIBRARY_DIRS}) - list(APPEND DEPENDENCY_LIB ${LIBZIP_LIBRARIES}) + if(TARGET libzip::zip) + list(APPEND DEPENDENCY_LIB libzip::zip) + else() + include_directories(AFTER ${LIBZIP_INCLUDE_DIRS}) + link_directories(${LIBZIP_LIBRARY_DIRS}) + list(APPEND DEPENDENCY_LIB ${LIBZIP_LIBRARIES}) + endif() list(APPEND FEATURES LIBZIP) list(APPEND VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-zip.c) string(REGEX MATCH "^[0-9]+" LIBZIP_VERSION_MAJOR "${libzip_VERSION}") if (LIBZIP_VERSION_MAJOR LESS 1) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libzip2") - elseif(LIBZIP_VERSION_MAJOR EQUAL 1) + elseif(LIBZIP_VERSION_MAJOR EQUAL 1 OR NOT LIBZIP_VERSION_MAJOR) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libzip4|libzip5") else() message(AUTHOR_WARNING "Unknown version of libzip detected: ${libzip_VERSION}")