Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show All 12 Lines | |||||
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) | ||||
option(ENABLE_GLIBC_BACK_COMPAT "Enable Glibc compatibility features" OFF) | option(ENABLE_GLIBC_BACK_COMPAT "Enable Glibc compatibility features" OFF) | ||||
option(ENABLE_REDUCE_EXPORTS "Avoid exporting symbols" OFF) | option(ENABLE_REDUCE_EXPORTS "Avoid exporting symbols" OFF) | ||||
option(ENABLE_STATIC_LIBSTDCXX "Statically link libstdc++" OFF) | |||||
# 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 All 22 Lines | if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||||
# Build all static so there is no dll file to distribute. | # Build all static so there is no dll file to distribute. | ||||
add_compiler_flag(-static) | add_compiler_flag(-static) | ||||
endif() | endif() | ||||
if(ENABLE_REDUCE_EXPORTS) | if(ENABLE_REDUCE_EXPORTS) | ||||
add_linker_flag(-Wl,--exclude-libs,ALL) | add_linker_flag(-Wl,--exclude-libs,ALL) | ||||
endif() | endif() | ||||
# Enable statically linking libstdc++ | |||||
if(ENABLE_STATIC_LIBSTDCXX) | |||||
add_linker_flag(-static-libstdc++) | |||||
endif() | |||||
# All windows code is PIC, forcing it on just adds useless compile warnings | # All windows code is PIC, forcing it on just adds useless compile warnings | ||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") | if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||||
add_compiler_flag(-fPIC) | add_compiler_flag(-fPIC) | ||||
endif() | endif() | ||||
if(ENABLE_HARDENING) | if(ENABLE_HARDENING) | ||||
# Enable stack protection | # Enable stack protection | ||||
add_cxx_compiler_flag(-fstack-protector-all -Wstack-protector) | add_cxx_compiler_flag(-fstack-protector-all -Wstack-protector) | ||||
▲ Show 20 Lines • Show All 336 Lines • Show Last 20 Lines |