rpcs3/3rdparty/zlib/CMakeLists.txt

22 lines
737 B
CMake
Raw Normal View History

if (USE_SYSTEM_ZLIB)
message(STATUS "RPCS3: Using system ZLIB")
2024-02-05 21:21:54 +00:00
find_package(ZLIB QUIET REQUIRED)
add_library(3rdparty_zlib INTERFACE)
2024-02-05 21:21:54 +00:00
target_link_libraries(3rdparty_zlib INTERFACE ZLIB::ZLIB)
target_compile_definitions(3rdparty_zlib INTERFACE -DZLIB_CONST=1)
else()
message(STATUS "RPCS3: Using builtin ZLIB")
set(SKIP_INSTALL_ALL ON)
add_subdirectory(zlib EXCLUDE_FROM_ALL)
add_library(3rdparty_zlib INTERFACE)
target_link_libraries(3rdparty_zlib INTERFACE zlibstatic)
target_include_directories(3rdparty_zlib INTERFACE zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib)
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()
endif()