Fix zlib INTERFACE usage

This commit is contained in:
Phillip Stephens 2021-11-23 21:46:52 -08:00
parent 066e3ae109
commit e13b498266
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
12 changed files with 15 additions and 13 deletions

View File

@ -23,24 +23,26 @@ else ()
trees.c
uncompr.c
zutil.c
crc32.h
deflate.h
gzguts.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zconf.h
zlib.h
zutil.h)
include/crc32.h
include/deflate.h
include/gzguts.h
include/inffast.h
include/inffixed.h
include/inflate.h
include/inftrees.h
include/trees.h
include/zconf.h
include/zlib.h
include/zutil.h)
if (WIN32 AND NOT UNIX)
install(FILES zconf.h zlib.h DESTINATION include COMPONENT zlib)
install(FILES include/zconf.h include/zlib.h DESTINATION include COMPONENT zlib)
install(TARGETS z DESTINATION lib COMPONENT zlib)
else ()
target_compile_options(z PRIVATE -Wno-implicit-fallthrough)
endif ()
target_include_directories(z INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(z PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
set(ZLIB_LIBRARIES z CACHE STRING "zlib libraries" FORCE)
set(ATHENA_ZLIB YES CACHE BOOL "Using built-in zlib" FORCE)
endif ()