File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ endif()
105
105
cmake_dependent_option (BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ${BUILD_TESTS} "ENABLE_WALLET" OFF )
106
106
107
107
option (ENABLE_HARDENING "Attempt to harden the resulting executables." ON )
108
+ option (REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting executables." OFF )
108
109
option (WITH_CCACHE "Attempt to use ccache for compiling." ON )
109
110
110
111
option (WITH_NATPMP "Enable NAT-PMP." OFF )
@@ -405,6 +406,12 @@ if(ENABLE_HARDENING)
405
406
endif ()
406
407
endif ()
407
408
409
+ if (REDUCE_EXPORTS )
410
+ set (CMAKE_CXX_VISIBILITY_PRESET hidden )
411
+ try_append_linker_flag ("-Wl,--exclude-libs,ALL" TARGET core_interface )
412
+ try_append_linker_flag ("-Wl,-no_exported_symbols" VAR CMAKE_EXE_LINKER_FLAGS )
413
+ endif ()
414
+
408
415
find_package (Python3 3.9 COMPONENTS Interpreter )
409
416
if (Python3_EXECUTABLE )
410
417
set (PYTHON_COMMAND ${Python3_EXECUTABLE} )
You can’t perform that action at this time.
0 commit comments