mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-12 10:30:08 +01: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
0930654e1c
commit
877a62e76a
6 changed files with 18 additions and 2 deletions
|
@ -140,6 +140,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)
|
||||
|
@ -226,6 +228,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)
|
||||
|
@ -660,6 +663,7 @@ if(ENABLE_WALLET)
|
|||
endif()
|
||||
message(" external signer ..................... ${ENABLE_EXTERNAL_SIGNER}")
|
||||
message(" ZeroMQ .............................. ${WITH_ZMQ}")
|
||||
message(" Embedded ASMap ...................... ${WITH_EMBEDDED_ASMAP}")
|
||||
message(" USDT tracing ........................ ${WITH_USDT}")
|
||||
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
|
||||
message(" DBus (GUI, Linux only) .............. ${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}")
|
||||
|
|
|
@ -303,6 +303,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 Core bitcoind.
|
||||
|
|
|
@ -24,6 +24,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)
|
||||
|
||||
|
|
|
@ -24,5 +24,6 @@ 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
|
||||
|
|
|
@ -1046,6 +1046,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…
Add table
Reference in a new issue