2021-06-02 05:33:50 +00:00
|
|
|
if (USE_SYSTEM_ZLIB)
|
2023-07-11 18:40:30 +00:00
|
|
|
message(STATUS "RPCS3: Using system ZLIB")
|
2024-02-05 21:21:54 +00:00
|
|
|
find_package(ZLIB QUIET REQUIRED)
|
2023-07-11 18:40:30 +00:00
|
|
|
|
|
|
|
add_library(3rdparty_zlib INTERFACE)
|
2024-02-05 21:21:54 +00:00
|
|
|
target_link_libraries(3rdparty_zlib INTERFACE ZLIB::ZLIB)
|
2023-10-11 23:21:35 +00:00
|
|
|
target_compile_definitions(3rdparty_zlib INTERFACE -DZLIB_CONST=1)
|
2021-06-02 05:33:50 +00:00
|
|
|
else()
|
2023-07-11 18:40:30 +00:00
|
|
|
message(STATUS "RPCS3: Using builtin ZLIB")
|
2021-06-02 05:33:50 +00:00
|
|
|
set(SKIP_INSTALL_ALL ON)
|
|
|
|
add_subdirectory(zlib EXCLUDE_FROM_ALL)
|
|
|
|
|
2023-07-11 18:40:30 +00:00
|
|
|
add_library(3rdparty_zlib INTERFACE)
|
|
|
|
target_link_libraries(3rdparty_zlib INTERFACE zlibstatic)
|
|
|
|
target_include_directories(3rdparty_zlib INTERFACE zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib)
|
2023-10-11 23:21:35 +00:00
|
|
|
target_compile_definitions(3rdparty_zlib INTERFACE -DZLIB_CONST=1)
|
2024-02-05 21:21:54 +00:00
|
|
|
|
2024-03-17 23:34:08 +00:00
|
|
|
if(NOT MSVC)
|
|
|
|
set(ZLIB_ROOT ${CMAKE_CURRENT_BINARY_DIR}/zlib PARENT_SCOPE)
|
|
|
|
endif()
|
2023-07-11 18:40:30 +00:00
|
|
|
endif()
|