mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
cmake: Add REDUCE_EXPORTS
option
This commit is contained in:
parent
a01cb6e63f
commit
c98d4a4c34
1 changed files with 7 additions and 0 deletions
|
@ -105,6 +105,7 @@ endif()
|
|||
cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ${BUILD_TESTS} "ENABLE_WALLET" OFF)
|
||||
|
||||
option(ENABLE_HARDENING "Attempt to harden the resulting executables." ON)
|
||||
option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting executables." OFF)
|
||||
option(WITH_CCACHE "Attempt to use ccache for compiling." ON)
|
||||
|
||||
option(WITH_NATPMP "Enable NAT-PMP." OFF)
|
||||
|
@ -405,6 +406,12 @@ if(ENABLE_HARDENING)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(REDUCE_EXPORTS)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
try_append_linker_flag("-Wl,--exclude-libs,ALL" TARGET core_interface)
|
||||
try_append_linker_flag("-Wl,-no_exported_symbols" VAR CMAKE_EXE_LINKER_FLAGS)
|
||||
endif()
|
||||
|
||||
find_package(Python3 3.9 COMPONENTS Interpreter)
|
||||
if(Python3_EXECUTABLE)
|
||||
set(PYTHON_COMMAND ${Python3_EXECUTABLE})
|
||||
|
|
Loading…
Add table
Reference in a new issue