diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-10-30 07:33:51 +0000 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-11-06 15:40:42 +0000 |
commit | ffda355b5a2113fa0f7db8015f7b08bf1351e245 (patch) | |
tree | 2aec32abc612213df2a7ce8e1a464bf3436d8f68 | |
parent | b619bdc3303217f4415342fe60e586e18fa48308 (diff) |
cmake, refactor: Move `HAVE_EVHTTP_...` to `libevent` interface
-rw-r--r-- | cmake/bitcoin-build-config.h.in | 3 | ||||
-rw-r--r-- | cmake/module/FindLibevent.cmake | 4 | ||||
-rw-r--r-- | 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 + $<$<BOOL:${HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR}>: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 <bitcoin-build-config.h> // IWYU pragma: keep - #include <httpserver.h> #include <chainparamsbase.h> |