mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
cmake: consolidate zlib/zstd library handling
Move the handling to the top-level, adding it _once_ to EXTRA_LIBS. Thus avoiding some duplication across the board. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
committed by
Sébastien Helleu
parent
20a7affb70
commit
b38c00bb0d
@@ -258,10 +258,12 @@ list(APPEND EXTRA_LIBS ${GNUTLS_LDFLAGS})
|
||||
|
||||
# Check for zlib
|
||||
find_package(ZLIB REQUIRED)
|
||||
list(APPEND EXTRA_LIBS ${ZLIB_LIBRARY})
|
||||
|
||||
# Check for zstd
|
||||
if(ENABLE_ZSTD)
|
||||
pkg_check_modules(LIBZSTD REQUIRED libzstd)
|
||||
list(APPEND EXTRA_LIBS ${LIBZSTD_LDFLAGS})
|
||||
add_definitions(-DHAVE_ZSTD)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -47,12 +47,6 @@ endif()
|
||||
|
||||
list(APPEND EXTRA_LIBS "m")
|
||||
|
||||
list(APPEND EXTRA_LIBS ${ZLIB_LIBRARY})
|
||||
|
||||
if(ENABLE_ZSTD)
|
||||
list(APPEND EXTRA_LIBS ${LIBZSTD_LDFLAGS})
|
||||
endif()
|
||||
|
||||
if(ENABLE_NCURSES)
|
||||
subdirs(normal)
|
||||
endif()
|
||||
|
||||
@@ -66,12 +66,6 @@ endif()
|
||||
|
||||
list(APPEND EXTRA_LIBS "m")
|
||||
|
||||
list(APPEND EXTRA_LIBS ${ZLIB_LIBRARY})
|
||||
|
||||
if(ENABLE_ZSTD)
|
||||
list(APPEND EXTRA_LIBS ${LIBZSTD_LDFLAGS})
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
# link with resolv lib on macOS
|
||||
list(APPEND EXTRA_LIBS "resolv")
|
||||
@@ -84,8 +78,6 @@ list(APPEND FUZZ_TARGET_LINK
|
||||
weechat_gui_headless
|
||||
weechat_ncurses_fake
|
||||
${EXTRA_LIBS}
|
||||
${ZLIB_LIBRARY}
|
||||
${LIBZSTD_LDFLAGS}
|
||||
-rdynamic
|
||||
)
|
||||
|
||||
|
||||
@@ -235,8 +235,6 @@ target_link_libraries(tests
|
||||
weechat_ncurses_fake
|
||||
weechat_unit_tests_core
|
||||
${EXTRA_LIBS}
|
||||
${ZLIB_LIBRARY}
|
||||
${LIBZSTD_LDFLAGS}
|
||||
${CPPUTEST_LIBRARIES}
|
||||
-rdynamic
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user