Skip to content

Commit

Permalink
cmake: Rename build option HARDENING to ENABLE_HARDENING
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed May 22, 2024
1 parent 576251f commit 9d6ebf4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ endif()
cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ON "ENABLE_WALLET" OFF)

option(THREADLOCAL "Enable features that depend on the C++ thread_local keyword (currently just thread names in debug logs)." ON)
option(HARDENING "Attempt to harden the resulting executables." ON)
option(ENABLE_HARDENING "Attempt to harden the resulting executables." ON)
option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting executables." OFF)
option(WERROR "Treat compiler warnings as errors." OFF)

Expand Down Expand Up @@ -495,7 +495,7 @@ try_append_cxx_flags("-fno-extended-identifiers" TARGET core_base_interface SKIP
# -fstack-reuse=none for all gcc builds. (Only gcc understands this flag).
try_append_cxx_flags("-fstack-reuse=none" TARGET core_base_interface)

if(HARDENING)
if(ENABLE_HARDENING)
add_library(hardening_interface INTERFACE)
target_link_libraries(core_base_interface INTERFACE hardening_interface)
if(MSVC)
Expand Down Expand Up @@ -647,7 +647,7 @@ message("Common link options ................... ${common_link_options}")
message("Linker flags for executables .......... ${CMAKE_EXE_LINKER_FLAGS} ${APPEND_LDFLAGS}")
message("Linker flags for shared libraries ..... ${CMAKE_SHARED_LINKER_FLAGS} ${APPEND_LDFLAGS}")
print_config_flags()
message("Attempt to harden executables ......... ${HARDENING}")
message("Attempt to harden executables ......... ${ENABLE_HARDENING}")
message("Treat compiler warnings as errors ..... ${WERROR}")
message("Use ccache for compiling .............. ${WITH_CCACHE}")
message("\n")
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export RUN_FUNCTIONAL_TESTS=false
export RUN_FUZZ_TESTS=false
export RUN_TIDY=true
export GOAL="install"
export BITCOIN_CONFIG="-DWARN_INCOMPATIBLE_BDB=OFF -DHARDENING=OFF \
export BITCOIN_CONFIG="-DWARN_INCOMPATIBLE_BDB=OFF -DENABLE_HARDENING=OFF \
-DCMAKE_C_COMPILER=clang-${TIDY_LLVM_V} -DCMAKE_CXX_COMPILER=clang++-${TIDY_LLVM_V} \
-DCMAKE_C_FLAGS_RELWITHDEBINFO='-O0 -g0' -DCMAKE_CXX_FLAGS_RELWITHDEBINFO='-O0 -g0'"
export CCACHE_MAXSIZE=200M
2 changes: 1 addition & 1 deletion cmake/module/Maintenance.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function(add_maintenance_targets)
VERBATIM
)

if(HARDENING)
if(ENABLE_HARDENING)
add_custom_target(check-security
COMMAND ${CMAKE_COMMAND} -E echo "Checking binary security..."
COMMAND ${PYTHON_COMMAND} ${CMAKE_SOURCE_DIR}/contrib/devtools/security-check.py ${executables}
Expand Down
4 changes: 2 additions & 2 deletions depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ else()
endif()

if("@no_harden@")
set(HARDENING OFF CACHE BOOL "")
set(ENABLE_HARDENING OFF CACHE BOOL "")
else()
set(HARDENING ON CACHE BOOL "")
set(ENABLE_HARDENING ON CACHE BOOL "")
endif()

if("@multiprocess@" STREQUAL "1")
Expand Down

0 comments on commit 9d6ebf4

Please sign in to comment.