Skip to content

Commit

Permalink
cmake: Add FUZZ option
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Nov 9, 2023
1 parent 1573024 commit 424296e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ tristate_option(WITH_USDT
option(BUILD_TESTS "Build test_bitcoin executable." ON)
option(BUILD_BENCH "Build bench_bitcoin executable." ON)
cmake_dependent_option(BUILD_FUZZ_BINARY "Build fuzz binary." ON "NOT MSVC" OFF)
cmake_dependent_option(FUZZ "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF "NOT MSVC" OFF)

if(FUZZ)
message(WARNING "FUZZ=ON will disable all other targets and force BUILD_FUZZ_BINARY=ON.")
set(BUILD_DAEMON OFF)
set(BUILD_CLI OFF)
set(BUILD_TX OFF)
set(BUILD_UTIL OFF)
set(BUILD_UTIL_CHAINSTATE OFF)
set(BUILD_SHARED OFF)
set(BUILD_BITCOINKERNEL_LIB OFF)
set(BUILD_WALLET_TOOL OFF)
set(WITH_NATPMP OFF)
set(WITH_MINIUPNPC OFF)
set(WITH_ZMQ OFF)
set(WITH_EXTERNAL_SIGNER OFF)
set(BUILD_TESTS OFF)
set(BUILD_BENCH OFF)
set(WITH_GUI no)
set(BUILD_FUZZ_BINARY ON)
endif()

option(INSTALL_MAN "Install man pages." ON)

Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function(create_test_config)
set_configure_variable(BUILD_UTIL BUILD_BITCOIN_UTIL)
set_configure_variable(BUILD_WALLET_TOOL BUILD_BITCOIN_WALLET)
set_configure_variable(BUILD_DAEMON BUILD_BITCOIND_TRUE)
set_configure_variable(FUZZ ENABLE_FUZZ)
set_configure_variable(WITH_ZMQ ENABLE_ZMQ)
set_configure_variable(ENABLE_EXTERNAL_SIGNER ENABLE_EXTERNAL_SIGNER)
set_configure_variable(ENABLE_TRACING ENABLE_USDT_TRACEPOINTS)
Expand Down

0 comments on commit 424296e

Please sign in to comment.