Skip to content

Commit

Permalink
cmake: hopefully fix minizip dep
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpasjuste committed Apr 18, 2024
1 parent 4aafc63 commit 7dcb506
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ add_subdirectory(external/libcross2d)
####################
set(OPTION_EMU OFF CACHE STRING "Emulator to build (pfbneo, pnes, psnes)")
set(OPTION_BUILTIN_LIBCONFIG OFF CACHE BOOL "Build libconfig from sources")
set(OPTION_BUILTIN_MINIZIP OFF CACHE BOOL "Build minizip from sources")
set(OPTION_MPV_PLAYER ON CACHE BOOL "Add support for video snaps (mpv)")
set(OPTION_UPDATE_CONFIG OFF CACHE BOOL "Force config file updating")
####################
Expand Down
15 changes: 9 additions & 6 deletions src/skeleton/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ project(cross2dui)
#################
# libcross2dui
#################
include(FindPkgConfig)

set(CROSS2DUI_INCLUDE ..)
file(GLOB CROSS2DUI_SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/*.c*
Expand All @@ -26,25 +28,26 @@ if (OPTION_MPV_PLAYER)
if (PLATFORM_WINDOWS)
list(APPEND LDFLAGS mpv.dll.a)
else ()
include(FindPkgConfig)
pkg_search_module(MPV REQUIRED mpv)
list(APPEND CROSS2DUI_INCLUDE ${MPV_INCLUDE_DIRS})
list(APPEND LDFLAGS ${MPV_LIBRARIES})
endif ()
list(APPEND FLAGS -D__MPV__)
endif ()

if (OPTION_BUILTIN_MINIZIP)
# minizip
pkg_search_module(MINIZIP minizip)
if (MINIZIP_FOUND)
list(APPEND CROSS2DUI_INCLUDE ${MINIZIP_INCLUDE_DIRS})
list(APPEND LDFLAGS ${MINIZIP_LIBRARIES})
else ()
message(WARNING "minizip not found, using embedded one...")
list(APPEND CROSS2DUI_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/external)
list(APPEND CROSS2DUI_SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/external/minizip/ioapi.c
${CMAKE_CURRENT_SOURCE_DIR}/external/minizip/zip.c
${CMAKE_CURRENT_SOURCE_DIR}/external/minizip/unzip.c)
list(APPEND FLAGS -DIOAPI_NO_64 -DUSE_FILE32API)
else ()
pkg_search_module(MINIZIP REQUIRED minizip)
list(APPEND CROSS2DUI_INCLUDE ${MINIZIP_INCLUDE_DIRS})
list(APPEND LDFLAGS ${MINIZIP_LIBRARIES})
endif ()

if (PLATFORM_LINUX OR PLATFORM_WINDOWS)
Expand Down

0 comments on commit 7dcb506

Please sign in to comment.