From 4453febf2dae7cd92e2c767de154fc4c57f178ff Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 20 Feb 2020 20:25:35 +0100 Subject: [PATCH] Build eventloop support libraries by default Resolves issue #169 --- CMakeLists.txt | 20 ++++++++++++++------ ChangeLog | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1f9142c..1dc5bbab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,9 +121,10 @@ option(BUILD_GETDNS_QUERY "Compile and install the getdns_query tool." ON) option(BUILD_GETDNS_SERVER_MON "Compile and install the getdns_server_mon tool." ON) option(BUILD_STUBBY "Compile and install stubby, the (stub) resolver daemon." OFF) -option(USE_LIBEV "Use libev if available." OFF) -option(USE_LIBEVENT2 "Use libevent2 if available." OFF) -option(USE_LIBUV "Use libuv if available." OFF) +option(BUILD_LIBEV "Build libev support library if available." ON) +option(BUILD_LIBEVENT2 "Build libevent2 support library if available." ON) +option(BUILD_LIBUV "Build libuv support library available." ON) + option(USE_LIBIDN2 "Use libidn2 if available." ON) option(USE_GNUTLS "Use GnuTLS for TLS connections." OFF) @@ -148,6 +149,10 @@ set(USE_ED448 ${ENABLE_ED448}) set(HAVE_MDNS_SUPPORT ${ENABLE_DRAFT_MDNS_SUPPORT}) set(STUB_NATIVE_DNSSEC ${ENABLE_NATIVE_STUB_DNSSEC}) +set(USE_LIBEV ${BUILD_LIBEV}) +set(USE_LIBEVENT2 ${BUILD_LIBEVENT2}) +set(USE_LIBUV ${BUILD_LIBUV}) + option(ENABLE_DEBUG_KEEP_CONNECTIONS_OPEN "Disable connection idle timeout. Do not enable.") mark_as_advanced(ENABLE_DEBUG_KEEP_CONNECTIONS_OPEN) set(KEEP_CONNECTIONS_OPEN_DEBUG ${ENABLE_DEBUG_KEEP_CONNECTIONS_OPEN}) @@ -741,7 +746,8 @@ if (USE_LIBEV) endif () endif () else () - message(FATAL_ERROR "Libev required but not found.") + message(WARNING "Libev support library build requested, but libev not found. Disabled.") + unset(USE_LIBEV) endif () endif () @@ -791,7 +797,8 @@ if (USE_LIBEVENT2) endif () endif () else () - message(FATAL_ERROR "Libevent2 required but not found.") + message(WARNING "Libevent2 support library build requested, but libevent2 not found. Disabled.") + unset(USE_LIBEVENT2) endif () endif () @@ -842,7 +849,8 @@ if (USE_LIBUV) endif () endif () else () - message(FATAL_ERROR "Libuv required but not found.") + message(WARNING "Libuv support library build requested, but libuv not found. Disabled.") + unset(USE_LIBUV) endif () endif () diff --git a/ChangeLog b/ChangeLog index 0be3df9a..b98a0086 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ src/test/tpkg/run-offline-only.sh (only with git checkouts). * Issue #175: Include the packet the stub resolver sent to the upstream the call_reporting dict. Thanks Tom Pusateri + * Issue #169: Build eventloop support libraries if event libraries + are available. Thanks Tom Pusateri * 2019-12-20: Version 1.6.0-beta.1 * Migration of build system to cmake. Build now works on Ubuntu,