Fixed #207 -- libmicrohttpd in FreeBSD no longer hangs on shut down so

we don't need to build it from source.
This commit is contained in:
casey langen 2018-12-23 12:44:29 +00:00
parent c06c774bd7
commit e01581495b

View File

@ -22,27 +22,7 @@ set (server_LINK_LIBS ${BOOST_LINK_LIBS})
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include")
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
# the version of libmicrohttpd that ships with FreeBSD hangs during shutdown,
# but newer versions is fine. snag the sources and compile them on-demand.
include (ExternalProject)
ExternalProject_Add(libmicrohttpd
URL https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.58.tar.gz
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./configure --enable-https=no --disable-curl --prefix=${CMAKE_CURRENT_SOURCE_DIR}/microhttpd/
BUILD_COMMAND make
INSTALL_COMMAND make install
TEST_COMMAND "")
add_dependencies(server libmicrohttpd)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/microhttpd/include")
file(GLOB OBJS "${CMAKE_CURRENT_SOURCE_DIR}/libmicrohttpd-prefix/src/libmicrohttpd/src/microhttpd/.libs/*.o")
target_link_libraries(server ${server_LINK_LIBS} "${OBJS}" z)
elseif (${LINK_STATICALLY} MATCHES "true")
if (${LINK_STATICALLY} MATCHES "true")
# prefer static libraries on mac to make redist easier
find_library(MICROHTTPDLIB NAMES libmicrohttpd.a microhttpd)
target_link_libraries(server ${server_LINK_LIBS} ${MICROHTTPDLIB} z)