mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-26 23:39:21 +00:00
build: Generate ip_asn.dat.h during build process
This can be disabled with -DWITH_EMBEDDED_ASMAP=OFF.
This commit is contained in:
parent
634cd60dc8
commit
6202b50fb9
@ -127,6 +127,8 @@ if(WITH_ZMQ)
|
||||
find_package(ZeroMQ 4.0.0 MODULE REQUIRED)
|
||||
endif()
|
||||
|
||||
option(WITH_EMBEDDED_ASMAP "Embed default ASMap data." ON)
|
||||
|
||||
option(WITH_USDT "Enable tracepoints for Userspace, Statically Defined Tracing." OFF)
|
||||
if(WITH_USDT)
|
||||
find_package(USDT MODULE REQUIRED)
|
||||
@ -216,6 +218,7 @@ if(BUILD_FOR_FUZZING)
|
||||
set(BUILD_GUI OFF)
|
||||
set(ENABLE_EXTERNAL_SIGNER OFF)
|
||||
set(WITH_ZMQ OFF)
|
||||
set(WITH_EMBEDDED_ASMAP OFF)
|
||||
set(BUILD_TESTS OFF)
|
||||
set(BUILD_GUI_TESTS OFF)
|
||||
set(BUILD_BENCH OFF)
|
||||
@ -667,6 +670,7 @@ else()
|
||||
set(ipc_status OFF)
|
||||
endif()
|
||||
message(" IPC ................................. ${ipc_status}")
|
||||
message(" Embedded ASMap ...................... ${WITH_EMBEDDED_ASMAP}")
|
||||
message(" USDT tracing ........................ ${WITH_USDT}")
|
||||
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
|
||||
message(" DBus (GUI) .......................... ${WITH_DBUS}")
|
||||
|
||||
@ -18,6 +18,5 @@ ${formatted_bytes}
|
||||
};
|
||||
|
||||
inline constexpr std::span ${raw_source_basename}{detail_${raw_source_basename}_raw};
|
||||
}
|
||||
")
|
||||
}")
|
||||
file(WRITE ${HEADER_PATH} "${header_content}")
|
||||
|
||||
@ -286,6 +286,13 @@ target_link_libraries(bitcoin_node
|
||||
$<TARGET_NAME_IF_EXISTS:libevent::pthreads>
|
||||
$<TARGET_NAME_IF_EXISTS:USDT::headers>
|
||||
)
|
||||
if(WITH_EMBEDDED_ASMAP)
|
||||
target_compile_definitions(bitcoin_node PRIVATE ENABLE_EMBEDDED_ASMAP=1)
|
||||
include(TargetDataSources)
|
||||
target_raw_data_sources(bitcoin_node NAMESPACE node::data
|
||||
node/data/ip_asn.dat
|
||||
)
|
||||
endif()
|
||||
|
||||
# Bitcoin wrapper executable that can call other executables.
|
||||
if(BUILD_BITCOIN_BIN)
|
||||
|
||||
@ -25,6 +25,7 @@ function(create_test_config)
|
||||
set_configure_variable(BUILD_DAEMON BUILD_BITCOIND)
|
||||
set_configure_variable(BUILD_FUZZ_BINARY ENABLE_FUZZ_BINARY)
|
||||
set_configure_variable(WITH_ZMQ ENABLE_ZMQ)
|
||||
set_configure_variable(WITH_EMBEDDED_ASMAP ENABLE_EMBEDDED_ASMAP)
|
||||
set_configure_variable(ENABLE_EXTERNAL_SIGNER ENABLE_EXTERNAL_SIGNER)
|
||||
set_configure_variable(WITH_USDT ENABLE_USDT_TRACEPOINTS)
|
||||
set_configure_variable(ENABLE_IPC ENABLE_IPC)
|
||||
|
||||
@ -25,6 +25,7 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py
|
||||
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true
|
||||
@ENABLE_FUZZ_BINARY_TRUE@ENABLE_FUZZ_BINARY=true
|
||||
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true
|
||||
@ENABLE_EMBEDDED_ASMAP_TRUE@ENABLE_EMBEDDED_ASMAP=true
|
||||
@ENABLE_EXTERNAL_SIGNER_TRUE@ENABLE_EXTERNAL_SIGNER=true
|
||||
@ENABLE_USDT_TRACEPOINTS_TRUE@ENABLE_USDT_TRACEPOINTS=true
|
||||
@ENABLE_IPC_TRUE@ENABLE_IPC=true
|
||||
|
||||
@ -1017,6 +1017,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
"""Checks whether the zmq module was compiled."""
|
||||
return self.config["components"].getboolean("ENABLE_ZMQ")
|
||||
|
||||
def is_embedded_asmap_compiled(self):
|
||||
"""Checks whether ASMap data was embedded during compilation."""
|
||||
return self.config["components"].getboolean("ENABLE_EMBEDDED_ASMAP")
|
||||
|
||||
def is_usdt_compiled(self):
|
||||
"""Checks whether the USDT tracepoints were compiled."""
|
||||
return self.config["components"].getboolean("ENABLE_USDT_TRACEPOINTS")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user