cmake: Support building nghttpx with systemd
This commit is contained in:
parent
7a5908933e
commit
4f7aedc9d2
|
@ -66,6 +66,7 @@ if(OPENSSL_FOUND AND LIBEV_FOUND AND ZLIB_FOUND)
|
|||
else()
|
||||
set(ENABLE_APP_DEFAULT OFF)
|
||||
endif()
|
||||
find_package(Systemd 209)
|
||||
find_package(Jansson 2.5)
|
||||
set(ENABLE_HPACK_TOOLS_DEFAULT ${JANSSON_FOUND})
|
||||
# 2.0.8 is required because we use evconnlistener_set_error_cb()
|
||||
|
@ -193,6 +194,7 @@ endif()
|
|||
# libev (for src)
|
||||
set(HAVE_LIBEV ${LIBEV_FOUND})
|
||||
set(HAVE_ZLIB ${ZLIB_FOUND})
|
||||
set(HAVE_SYSTEMD ${SYSTEMD_FOUND})
|
||||
set(HAVE_LIBEVENT_OPENSSL ${LIBEVENT_FOUND})
|
||||
if(LIBEVENT_FOUND)
|
||||
# Must both link the core and openssl libraries.
|
||||
|
@ -497,6 +499,7 @@ message(STATUS "summary of build options:
|
|||
Jansson: ${HAVE_JANSSON} (LIBS='${JANSSON_LIBRARIES}')
|
||||
Jemalloc: ${HAVE_JEMALLOC} (LIBS='${JEMALLOC_LIBRARIES}')
|
||||
Zlib: ${HAVE_ZLIB} (LIBS='${ZLIB_LIBRARIES}')
|
||||
Systemd: ${HAVE_SYSTEMD} (LIBS='${SYSTEMD_LIBRARIES}')
|
||||
Boost::System: ${Boost_SYSTEM_LIBRARY}
|
||||
Boost::Thread: ${Boost_THREAD_LIBRARY}
|
||||
Third-party:
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# - Try to find systemd
|
||||
# Once done this will define
|
||||
# SYSTEMD_FOUND - System has systemd
|
||||
# SYSTEMD_INCLUDE_DIRS - The systemd include directories
|
||||
# SYSTEMD_LIBRARIES - The libraries needed to use systemd
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(Systemd PROPERTIES
|
||||
URL "http://freedesktop.org/wiki/Software/systemd/"
|
||||
DESCRIPTION "System and Service Manager")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_SYSTEMD QUIET libsystemd)
|
||||
find_library(SYSTEMD_LIBRARIES NAMES systemd ${PC_SYSTEMD_LIBRARY_DIRS})
|
||||
find_path(SYSTEMD_INCLUDE_DIRS systemd/sd-login.h HINTS ${PC_SYSTEMD_INCLUDE_DIRS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SYSTEMD DEFAULT_MSG SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES)
|
||||
mark_as_advanced(SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES)
|
|
@ -126,6 +126,12 @@ if(ENABLE_APP)
|
|||
shrpx.cc
|
||||
)
|
||||
|
||||
if(HAVE_SYSTEMD)
|
||||
target_link_libraries(nghttpx_static ${SYSTEMD_LIBRARIES})
|
||||
target_compile_definitions(nghttpx_static PUBLIC HAVE_LIBSYSTEMD)
|
||||
target_include_directories(nghttpx_static PUBLIC ${SYSTEMD_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(HAVE_MRUBY)
|
||||
target_link_libraries(nghttpx_static mruby-lib)
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue