mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Added code back to conditionally build libmicrohttpd -- but this time for macOS.
This commit is contained in:
parent
a181e3d56a
commit
208c1a04de
@ -22,15 +22,34 @@ set (server_LINK_LIBS ${BOOST_LINK_LIBS})
|
||||
|
||||
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include")
|
||||
|
||||
set(EXTRA_LIBS "")
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
set(EXTRA_LIBS "gnutls")
|
||||
endif()
|
||||
|
||||
if (${LINK_STATICALLY} MATCHES "true")
|
||||
# prefer static libraries on mac to make redist easier
|
||||
# libmicrohttpd on macOS now depends on `gnutls`. when we build statically,
|
||||
# we also need to build libmicrohttpd ourselves and disable TLS to avoid this
|
||||
# homebrew-only dependency
|
||||
set(EXTRA_OBJS "")
|
||||
set(MICROHTTPDLIB "")
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
include (ExternalProject)
|
||||
|
||||
ExternalProject_Add(libmicrohttpd
|
||||
URL https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.62.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 EXTRA_OBJS "${CMAKE_CURRENT_SOURCE_DIR}/libmicrohttpd-prefix/src/libmicrohttpd/src/microhttpd/.libs/*.o")
|
||||
else()
|
||||
find_library(MICROHTTPDLIB NAMES libmicrohttpd.a microhttpd)
|
||||
target_link_libraries(server ${server_LINK_LIBS} ${MICROHTTPDLIB} z ${EXTRA_LIBS})
|
||||
endif()
|
||||
target_link_libraries(server ${server_LINK_LIBS} ${MICROHTTPDLIB} z ${EXTRA_OBJS})
|
||||
else()
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user