Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
# Copyright (c) 2017 The Bitcoin developers | # Copyright (c) 2017 The Bitcoin developers | ||||
cmake_minimum_required(VERSION 3.5) | cmake_minimum_required(VERSION 3.12) | ||||
project(bitcoind) | project(bitcoind) | ||||
set(CMAKE_CXX_STANDARD 14) | set(CMAKE_CXX_STANDARD 14) | ||||
# Default visibility is hidden on all targets. | # Default visibility is hidden on all targets. | ||||
set(CMAKE_C_VISIBILITY_PRESET hidden) | set(CMAKE_C_VISIBILITY_PRESET hidden) | ||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden) | set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||||
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(BUILD_LIBBITCOINCONSENSUS "Build the bitcoinconsenus shared library" ON) | |||||
option(ENABLE_HARDENING "Harden the executables" ON) | option(ENABLE_HARDENING "Harden the executables" ON) | ||||
option(ENABLE_REDUCE_EXPORTS "Reduce the amount of exported symbols" OFF) | option(ENABLE_REDUCE_EXPORTS "Reduce the amount of exported symbols" OFF) | ||||
option(ENABLE_STATIC_LIBSTDCXX "Statically link libstdc++" OFF) | option(ENABLE_STATIC_LIBSTDCXX "Statically link libstdc++" OFF) | ||||
option(ENABLE_GLIBC_BACK_COMPAT "Enable Glibc compatibility features" OFF) | option(ENABLE_GLIBC_BACK_COMPAT "Enable Glibc compatibility features" OFF) | ||||
option(ENABLE_QRCODE "Enable QR code display" ON) | option(ENABLE_QRCODE "Enable QR code display" ON) | ||||
option(ENABLE_UPNP "Enable UPnP support" ON) | option(ENABLE_UPNP "Enable UPnP support" ON) | ||||
option(START_WITH_UPNP "Make UPnP the default to map ports" OFF) | option(START_WITH_UPNP "Make UPnP the default to map ports" OFF) | ||||
▲ Show 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | add_library(common | ||||
scheduler.cpp | scheduler.cpp | ||||
warnings.cpp | warnings.cpp | ||||
) | ) | ||||
target_link_libraries(common util secp256k1) | target_link_libraries(common util secp256k1) | ||||
# script library | # script library | ||||
add_library(script | add_library(script | ||||
script/bitcoinconsensus.cpp | |||||
script/bitfield.cpp | script/bitfield.cpp | ||||
script/interpreter.cpp | script/interpreter.cpp | ||||
script/ismine.cpp | script/ismine.cpp | ||||
script/script.cpp | script/script.cpp | ||||
script/script_error.cpp | script/script_error.cpp | ||||
script/sigencoding.cpp | script/sigencoding.cpp | ||||
script/sign.cpp | script/sign.cpp | ||||
script/standard.cpp | script/standard.cpp | ||||
) | ) | ||||
target_link_libraries(script common) | target_link_libraries(script common) | ||||
# libbitcoinconsensus | # libbitcoinconsensus | ||||
add_library(bitcoinconsensus | set(BITCOINCONSENSUS_SOURCES | ||||
arith_uint256.cpp | arith_uint256.cpp | ||||
hash.cpp | hash.cpp | ||||
primitives/transaction.cpp | primitives/transaction.cpp | ||||
pubkey.cpp | pubkey.cpp | ||||
uint256.cpp | uint256.cpp | ||||
util/strencodings.cpp | util/strencodings.cpp | ||||
) | ) | ||||
target_link_libraries(bitcoinconsensus script) | if(BUILD_LIBBITCOINCONSENSUS) | ||||
list(APPEND BITCOINCONSENSUS_SOURCES | |||||
script/bitcoinconsensus.cpp | |||||
) | |||||
set(BITCOINCONSENSUS_PUBLIC_HEADERS | |||||
PUBLIC_HEADERS script/bitcoinconsensus.h | |||||
) | |||||
# Export the symbols from script/bitcoinconsensus.h. | |||||
set(BITCOINCONSENSUS_DEFINITIONS | |||||
DEFINITIONS BUILD_BITCOIN_INTERNAL | |||||
) | |||||
# If BUILD_LIBBITCOINCONSENSUS is set, build both static and shared. | |||||
# Otherwise don't set the type explicitly so it is set according to the | |||||
# BUILD_SHARED_LIBS switch. | |||||
# Also install the library only in this case. It is pointless to install the | |||||
# library if there is no exported symbol. | |||||
set(BITCOINCONSENSUS_FEATURES | |||||
STATIC | |||||
SHARED | |||||
INSTALL | |||||
) | |||||
endif() | |||||
# For autotools compatibility, rename the library to libbitcoinconsensus-0.dll | |||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |||||
set(BITCOINCONSENSUS_NAME "bitcoinconsensus-${bitcoin-abc_VERSION_MAJOR}") | |||||
else() | |||||
set(BITCOINCONSENSUS_NAME "bitcoinconsensus") | |||||
endif() | |||||
include(AddBitcoinABC) | |||||
abc_add_library(bitcoinconsensus | |||||
${BITCOINCONSENSUS_FEATURES} | |||||
${BITCOINCONSENSUS_SOURCES} | |||||
${BITCOINCONSENSUS_PUBLIC_HEADERS} | |||||
${BITCOINCONSENSUS_DEFINITIONS} | |||||
OUTPUT_NAME ${BITCOINCONSENSUS_NAME} | |||||
LINK_LIBS script | |||||
) | |||||
# Bitcoin server facilities | # Bitcoin server facilities | ||||
add_library(server | add_library(server | ||||
addrdb.cpp | addrdb.cpp | ||||
addrman.cpp | addrman.cpp | ||||
avalanche.cpp | avalanche.cpp | ||||
banman.cpp | banman.cpp | ||||
bloom.cpp | bloom.cpp | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |