Unverified Commit e575a2aa authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa Committed by GitHub

Merge pull request #1377 from Aldrog/cmake_systemd

Support building nghttpx with systemd using cmake
parents 7a590893 4f7aedc9
......@@ -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:
......
# - 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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment