Files
TIC-80/cmake/zlib.cmake
Carsten Teibes e9d10fe29b Revamp the 3DS port (#2864)
- fix use of deprecated macro
- move network stuff to platform directory
- ensure all lua is built for 32 bit integers
- clean up build configurations
- use newer docker image
2025-11-20 09:31:26 +01:00

34 lines
849 B
CMake

################################
# ZLIB
################################
if(PREFER_SYSTEM_LIBRARIES)
find_package(PkgConfig)
pkg_check_modules(zlib IMPORTED_TARGET GLOBAL zlib)
if (zlib_FOUND)
add_library(zlib ALIAS PkgConfig::zlib)
message(STATUS "Use system library: zlib")
return()
else()
message(WARNING "System library zlib not found")
endif()
endif()
set(ZLIB_DIR ${THIRDPARTY_DIR}/zlib)
set(ZLIB_SRC
${ZLIB_DIR}/adler32.c
${ZLIB_DIR}/compress.c
${ZLIB_DIR}/crc32.c
${ZLIB_DIR}/deflate.c
${ZLIB_DIR}/inflate.c
${ZLIB_DIR}/infback.c
${ZLIB_DIR}/inftrees.c
${ZLIB_DIR}/inffast.c
${ZLIB_DIR}/trees.c
${ZLIB_DIR}/uncompr.c
${ZLIB_DIR}/zutil.c
)
add_library(zlib STATIC ${ZLIB_SRC})
target_include_directories(zlib INTERFACE ${THIRDPARTY_DIR}/zlib)