Fix libmicrohttpd linking.

This commit is contained in:
casey langen 2022-02-07 20:00:11 -08:00
parent e357a1fd9d
commit a8383b3469

View File

@ -15,15 +15,15 @@ set (server_LINK_LIBS ${Boost_LIBRARIES})
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include")
include_directories(${Boost_INCLUDE_DIRS})
ensure_library_exists(microhttpd)
# if (${LINK_STATICALLY} MATCHES "true")
# find_library(MICROHTTPDLIB NAMES libmicrohttpd.a)
# target_link_libraries(server ${server_LINK_LIBS} ${MICROHTTPDLIB})
# else()
if (${LINK_STATICALLY} MATCHES "true")
find_library(LIBMICROHTTPD NAMES libmicrohttpd.a)
find_library(LIBZ NAMES libz.a)
target_link_libraries(server ${server_LINK_LIBS} ${LIBZ} ${LIBMICROHTTPD})
else()
ensure_library_exists(microhttpd)
set(EXTRA_LIBS "")
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(EXTRA_LIBS "gnutls")
endif()
target_link_libraries(server ${server_LINK_LIBS} microhttpd z ${EXTRA_LIBS})
# endif()
endif()