1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

cmake: make sure libz is at end of link if enabled

https://github.com/warmcat/libwebsockets/issues/1840
This commit is contained in:
Andy Green 2020-02-17 19:10:52 +00:00
parent 17357ddd5a
commit 77c1294bd8

View file

@ -1680,7 +1680,8 @@ if (LWS_WITH_ZLIB)
message("zlib/miniz include dirs: ${ZLIB_INCLUDE_DIRS}")
message("zlib/miniz libraries: ${ZLIB_LIBRARIES}")
include_directories(${ZLIB_INCLUDE_DIRS})
list(APPEND LIB_LIST ${ZLIB_LIBRARIES})
# done later at end of link list
# list(APPEND LIB_LIST ${ZLIB_LIBRARIES})
endif()
if (LWS_WITH_HTTP_BROTLI)
@ -1846,6 +1847,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
list(APPEND LIB_LIST socket)
endif()
#
# add libs here that need to be at the end of the link order
#
if (UNIX)
list(APPEND LIB_LIST m)
endif()
@ -1866,6 +1871,9 @@ if (UNIX)
list(APPEND LIB_LIST dl)
endif()
if (LWS_WITH_ZLIB AND NOT LWS_WITH_BUNDLED_ZLIB)
list(APPEND LIB_LIST "${ZLIB_LIBRARIES}")
endif()
# Setup the linking for all libs.
foreach (lib ${LWS_LIBRARIES})