Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show All 11 Lines | |||||
option(BUILD_BITCOIN_WALLET "Activate the wallet functionality" ON) | option(BUILD_BITCOIN_WALLET "Activate the wallet functionality" ON) | ||||
option(BUILD_BITCOIN_ZMQ "Activate the ZeroMQ functionalities" ON) | option(BUILD_BITCOIN_ZMQ "Activate the ZeroMQ functionalities" ON) | ||||
option(BUILD_BITCOIN_SEEDER "Build bitcoin-seeder" ON) | option(BUILD_BITCOIN_SEEDER "Build bitcoin-seeder" ON) | ||||
option(BUILD_BITCOIN_CLI "Build bitcoin-cli" ON) | option(BUILD_BITCOIN_CLI "Build bitcoin-cli" ON) | ||||
option(BUILD_BITCOIN_TX "Build bitcoin-tx" ON) | option(BUILD_BITCOIN_TX "Build bitcoin-tx" ON) | ||||
option(BUILD_BITCOIN_QT "Build bitcoin-qt" ON) | option(BUILD_BITCOIN_QT "Build bitcoin-qt" ON) | ||||
option(ENABLE_HARDENING "Harden the executables" ON) | option(ENABLE_HARDENING "Harden the executables" ON) | ||||
# ENABLE_UPNP is a tristate option: | |||||
# - AUTO (default): enable if miniupnpc is installed, disable otherwise | |||||
# - ON: force enable, make miniupnpc a requirement | |||||
# - OFF: force disable | |||||
deadalnix: That is a bad idea to activate or deactivate options based on our buggy software. | |||||
set(ENABLE_UPNP AUTO CACHE STRING "Enable UPnP") | |||||
set_property(CACHE ENABLE_UPNP PROPERTY STRINGS AUTO ON OFF) | |||||
option(USE_UPNP_DEFAULT "Make UPnP the default to map ports" OFF) | |||||
deadalnixUnsubmitted Not Done Inline ActionsThis is a very bad option name. It impossible to get a sense of what it does without the comment. deadalnix: This is a very bad option name. It impossible to get a sense of what it does without the… | |||||
# Cmake uses the CMAKE_BUILD_TYPE variable to select the build configuration. | # Cmake uses the CMAKE_BUILD_TYPE variable to select the build configuration. | ||||
# By default it supports more configurations that needed for Bitcoin ABC, and | # By default it supports more configurations that needed for Bitcoin ABC, and | ||||
# all the releases types set NDEBUG which is unwanted as it disables the assert | # all the releases types set NDEBUG which is unwanted as it disables the assert | ||||
# completely. | # completely. | ||||
# Remove the -DNDEBUG flag from the CFLAGS/CXXFLAGS in all the configurations | # Remove the -DNDEBUG flag from the CFLAGS/CXXFLAGS in all the configurations | ||||
include(AddCompilerFlags) | include(AddCompilerFlags) | ||||
remove_compiler_flags(-DNDEBUG) | remove_compiler_flags(-DNDEBUG) | ||||
▲ Show 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | |||||
target_link_libraries(server | target_link_libraries(server | ||||
Event | Event | ||||
bitcoinconsensus | bitcoinconsensus | ||||
leveldb | leveldb | ||||
memenv | memenv | ||||
) | ) | ||||
if(USE_UPNP) | |||||
target_include_directories(server PUBLIC ${MINIUPNPC_INCLUDE_DIR}) | |||||
target_link_libraries(server ${MINIUPNPC_LIBRARY}) | |||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |||||
find_library(IPHLPAPI_LIBRARY NAMES iphlpapi) | |||||
if(NOT IPHLPAPI_LIBRARY) | |||||
message(FATAL_ERROR "Lib iphlpapi is missing") | |||||
endif() | |||||
target_link_libraries(server ${IPHLPAPI_LIBRARY}) | |||||
deadalnixUnsubmitted Not Done Inline ActionsPresumably, this library has headers somewhere and comes with an include path. deadalnix: Presumably, this library has headers somewhere and comes with an include path. | |||||
FabienAuthorUnsubmitted Done Inline ActionsIt's OK because we are not building miniupnpc, only the symbols are required for linkage. Fabien: It's OK because we are not building miniupnpc, only the symbols are required for linkage. | |||||
target_compile_definitions(server | |||||
PUBLIC -DSTATICLIB | |||||
PUBLIC -DMINIUPNP_STATICLIB | |||||
) | |||||
endif() | |||||
endif() | |||||
# Test suite. | # Test suite. | ||||
add_subdirectory(test) | add_subdirectory(test) | ||||
# Benchmark suite. | # Benchmark suite. | ||||
add_subdirectory(bench) | add_subdirectory(bench) | ||||
# Wallet | # Wallet | ||||
if(BUILD_BITCOIN_WALLET) | if(BUILD_BITCOIN_WALLET) | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
That is a bad idea to activate or deactivate options based on our buggy software.