Statically link libzip

This commit is contained in:
U-RAYYAN-PC\Rayyan 2020-08-05 14:50:18 +01:00
parent c351e777b4
commit 7e5eafe345
2 changed files with 9 additions and 7 deletions

View File

@ -93,9 +93,9 @@ if (ENABLE_JIT)
endif()
endif()
find_library(LIBZIP_LIB zip)
if (WIN32)
target_link_libraries(core ole32 comctl32 ws2_32 opengl32 ${LIBZIP_LIB})
target_link_libraries(core ole32 comctl32 ws2_32 opengl32)
else()
target_link_libraries(core GL EGL ${LIBZIP_LIB})
target_link_libraries(core GL EGL)
endif()

View File

@ -47,6 +47,7 @@ set(CMAKE_AUTORCC ON)
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(LIBZIP REQUIRED libzip)
if (WIN32 AND (CMAKE_BUILD_TYPE STREQUAL Release))
add_executable(melonDS WIN32 ${SOURCES_QT_SDL})
@ -57,15 +58,16 @@ endif()
target_link_libraries(melonDS ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(melonDS PRIVATE ${SDL2_INCLUDE_DIRS})
target_include_directories(melonDS PRIVATE ${LIBZIP_INCLUDE_DIRS})
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..")
target_link_libraries(melonDS core)
if (BUILD_STATIC)
target_link_libraries(melonDS -static ${SDL2_LIBRARIES})
target_link_libraries(melonDS -static ${SDL2_LIBRARIES} ${LIBZIP_STATIC_LIBRARIES})
else()
target_link_libraries(melonDS ${SDL2_LIBRARIES})
target_link_libraries(melonDS ${SDL2_LIBRARIES} ${LIBZIP_LIBRARIES})
endif()
if (UNIX)
@ -75,9 +77,9 @@ elseif (WIN32)
option(PORTABLE "Make a portable build that looks for its configuration in the current directory" ON)
target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc")
target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32)
target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32 bcrypt)
if (BUILD_STATIC)
target_link_libraries(melonDS imm32 winmm version setupapi -static Qt5::Core Qt5::Gui Qt5::Widgets z zstd)
target_link_libraries(melonDS imm32 winmm version setupapi -static Qt5::Core Qt5::Gui Qt5::Widgets zstd)
else()
target_link_libraries(melonDS Qt5::Core Qt5::Gui Qt5::Widgets)
endif()