From ffda355b5a2113fa0f7db8015f7b08bf1351e245 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 30 Oct 2024 07:33:51 +0000 Subject: [PATCH] cmake, refactor: Move `HAVE_EVHTTP_...` to `libevent` interface --- cmake/bitcoin-build-config.h.in | 3 --- cmake/module/FindLibevent.cmake | 4 +++- src/httpserver.cpp | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cmake/bitcoin-build-config.h.in b/cmake/bitcoin-build-config.h.in index dce9261da2..56e0519fac 100644 --- a/cmake/bitcoin-build-config.h.in +++ b/cmake/bitcoin-build-config.h.in @@ -71,9 +71,6 @@ */ #cmakedefine01 HAVE_DECL_SETSID -/* Define this symbol if evhttp_connection_get_peer expects const char** */ -#cmakedefine HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR 1 - /* Define to 1 if fdatasync is available. */ #cmakedefine HAVE_FDATASYNC 1 diff --git a/cmake/module/FindLibevent.cmake b/cmake/module/FindLibevent.cmake index 280e38adf9..c006b43d60 100644 --- a/cmake/module/FindLibevent.cmake +++ b/cmake/module/FindLibevent.cmake @@ -35,7 +35,9 @@ function(check_evhttp_connection_get_peer target) " HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR ) cmake_pop_check_state() - set(HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR ${HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR} PARENT_SCOPE) + target_compile_definitions(${target} INTERFACE + $<$:HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR> + ) endfunction() set(_libevent_components core extra) diff --git a/src/httpserver.cpp b/src/httpserver.cpp index b8772ed852..e37bc21dea 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -2,8 +2,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include // IWYU pragma: keep - #include #include