Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show All 20 Lines | |||||
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) | ||||
option(ENABLE_CLANG_TIDY "Enable clang-tidy checks for Bitcoin ABC" OFF) | option(ENABLE_CLANG_TIDY "Enable clang-tidy checks for Bitcoin ABC" OFF) | ||||
option(ENABLE_PROFILING "Select the profiling tool to use" OFF) | option(ENABLE_PROFILING "Select the profiling tool to use" OFF) | ||||
option(USE_LD_GOLD "Try to use gold as a linker if available" ON) | option(USE_LD_GOLD "Try to use gold as a linker if available" ON) | ||||
option(USE_JEMALLOC_EXPERIMENTAL "Use jemalloc as an allocation library (experimental)" OFF) | option(USE_JEMALLOC "Use jemalloc as an allocation library" ON) | ||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") | if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||||
set(DEFAULT_ENABLE_DBUS_NOTIFICATIONS ON) | set(DEFAULT_ENABLE_DBUS_NOTIFICATIONS ON) | ||||
endif() | endif() | ||||
option(ENABLE_DBUS_NOTIFICATIONS "Enable DBus desktop notifications. Linux only." ${DEFAULT_ENABLE_DBUS_NOTIFICATIONS}) | option(ENABLE_DBUS_NOTIFICATIONS "Enable DBus desktop notifications. Linux only." ${DEFAULT_ENABLE_DBUS_NOTIFICATIONS}) | ||||
# If ccache is available, then use it. | # If ccache is available, then use it. | ||||
find_program(CCACHE ccache) | find_program(CCACHE ccache) | ||||
if(CCACHE) | if(CCACHE) | ||||
message(STATUS "Using ccache: ${CCACHE}") | message(STATUS "Using ccache: ${CCACHE}") | ||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE}) | set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE}) | ||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) | set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) | ||||
endif(CCACHE) | endif(CCACHE) | ||||
# Disable what we do not need for the native build. | # Disable what we do not need for the native build. | ||||
include(NativeExecutable) | include(NativeExecutable) | ||||
native_add_cmake_flags( | native_add_cmake_flags( | ||||
"-DBUILD_BITCOIN_WALLET=OFF" | "-DBUILD_BITCOIN_WALLET=OFF" | ||||
"-DBUILD_BITCOIN_QT=OFF" | "-DBUILD_BITCOIN_QT=OFF" | ||||
"-DBUILD_BITCOIN_ZMQ=OFF" | "-DBUILD_BITCOIN_ZMQ=OFF" | ||||
"-DENABLE_QRCODE=OFF" | "-DENABLE_QRCODE=OFF" | ||||
"-DENABLE_UPNP=OFF" | "-DENABLE_UPNP=OFF" | ||||
"-DUSE_JEMALLOC=OFF" | |||||
# Forward the current setting for clang-tidy | # Forward the current setting for clang-tidy | ||||
"-DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY}" | "-DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY}" | ||||
) | ) | ||||
if(ENABLE_CLANG_TIDY) | if(ENABLE_CLANG_TIDY) | ||||
include(ClangTidy) | include(ClangTidy) | ||||
endif() | endif() | ||||
▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | if(ENABLE_GLIBC_BACK_COMPAT) | ||||
add_linker_flags(-Wl,--wrap=__divmoddi4) | add_linker_flags(-Wl,--wrap=__divmoddi4) | ||||
add_linker_flags(-Wl,--wrap=log2f) | add_linker_flags(-Wl,--wrap=log2f) | ||||
if(NOT HAVE_LARGE_FILE_SUPPORT) | if(NOT HAVE_LARGE_FILE_SUPPORT) | ||||
add_linker_flags(-Wl,--wrap=fcntl -Wl,--wrap=fcntl64) | add_linker_flags(-Wl,--wrap=fcntl -Wl,--wrap=fcntl64) | ||||
endif() | endif() | ||||
endif() | endif() | ||||
if(USE_JEMALLOC_EXPERIMENTAL) | if(USE_JEMALLOC) | ||||
# Most of the sanitizers require their instrumented allocation functions to | # Most of the sanitizers require their instrumented allocation functions to | ||||
# be fully functional. This is obviously the case for all the memory related | # be fully functional. This is obviously the case for all the memory related | ||||
# sanitizers (asan, lsan, msan) but not only. | # sanitizers (asan, lsan, msan) but not only. | ||||
if(ENABLE_SANITIZERS) | if(ENABLE_SANITIZERS) | ||||
message(WARNING "Jemalloc is incompatible with the sanitizers and has been disabled.") | message(WARNING "Jemalloc is incompatible with the sanitizers and has been disabled.") | ||||
else() | else() | ||||
find_package(Jemalloc REQUIRED) | find_package(Jemalloc 3.6.0 REQUIRED) | ||||
link_libraries(Jemalloc::jemalloc) | link_libraries(Jemalloc::jemalloc) | ||||
endif() | endif() | ||||
endif() | endif() | ||||
# Make sure that all the global compiler and linker flags are set BEFORE | # Make sure that all the global compiler and linker flags are set BEFORE | ||||
# including the libraries so they apply as needed. | # including the libraries so they apply as needed. | ||||
▲ Show 20 Lines • Show All 415 Lines • Show Last 20 Lines |