Skip to content

Commit 06872ef

Browse files
committed
Merge #196: cmake: Adjust build option defaults
b1b4977 cmake: Make `BUILD_<util>` defaults dependent on `BUILD_TESTS` (Hennadii Stepanov) 9f55197 cmake: Disable by default `BUILD_BENCH` and `BUILD_FUZZ_BINARY` (Hennadii Stepanov) Pull request description: This PR adjusts build option defaults per the discussion during today's call. ACKs for top commit: theuni: ACK b1b4977 Tree-SHA512: d21b4c087f881ed913239557056d81780edf9c51a5416eaf511737f6af27f835443790d15752a4858851f43762674e5a7ed0412afd48f5026b266530d7223a09
2 parents 997b7c5 + b1b4977 commit 06872ef

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188

189189
- name: Generate build system
190190
run: |
191-
cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DWERROR=ON
191+
cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
192192
193193
- name: Save vcpkg binary cache
194194
uses: actions/cache/save@v4

CMakeLists.txt

+8-6
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ include(CMakeDependentOption)
6565
option(BUILD_DAEMON "Build bitcoind executable." ON)
6666
option(BUILD_GUI "Build bitcoin-qt executable." OFF)
6767
option(BUILD_CLI "Build bitcoin-cli executable." ON)
68-
option(BUILD_TX "Build bitcoin-tx executable." ON)
69-
option(BUILD_UTIL "Build bitcoin-util executable." ON)
68+
69+
option(BUILD_TESTS "Build test_bitcoin executable." ON)
70+
option(BUILD_TX "Build bitcoin-tx executable." ${BUILD_TESTS})
71+
option(BUILD_UTIL "Build bitcoin-util executable." ${BUILD_TESTS})
72+
7073
option(BUILD_UTIL_CHAINSTATE "Build experimental bitcoin-chainstate executable." OFF)
7174
option(BUILD_KERNEL_LIB "Build experimental bitcoinkernel library." ${BUILD_UTIL_CHAINSTATE})
7275

@@ -99,7 +102,7 @@ if(WITH_BDB)
99102
endif()
100103
endif()
101104
endif()
102-
cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ON "ENABLE_WALLET" OFF)
105+
cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ${BUILD_TESTS} "ENABLE_WALLET" OFF)
103106

104107
option(ENABLE_THREADLOCAL "Enable features that depend on the C++ thread_local keyword (currently just thread names in debug logs)." ON)
105108
option(ENABLE_HARDENING "Attempt to harden the resulting executables." ON)
@@ -160,10 +163,9 @@ if(WITH_MULTIPROCESS)
160163
find_package(LibmultiprocessGen CONFIG REQUIRED)
161164
endif()
162165

163-
option(BUILD_TESTS "Build test_bitcoin executable." ON)
164166
cmake_dependent_option(BUILD_GUI_TESTS "Build test_bitcoin-qt executable." ON "BUILD_GUI;BUILD_TESTS" OFF)
165-
option(BUILD_BENCH "Build bench_bitcoin executable." ON)
166-
option(BUILD_FUZZ_BINARY "Build fuzz binary." ON)
167+
option(BUILD_BENCH "Build bench_bitcoin executable." OFF)
168+
option(BUILD_FUZZ_BINARY "Build fuzz binary." OFF)
167169
cmake_dependent_option(ENABLE_FUZZ "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF "NOT MSVC" OFF)
168170

169171
option(INSTALL_MAN "Install man pages." ON)

CMakePresets.json

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"name": "ci-common",
77
"hidden": true,
88
"cacheVariables": {
9+
"BUILD_BENCH": "ON",
10+
"BUILD_FUZZ_BINARY": "ON",
911
"ENABLE_WALLET": "ON",
1012
"WITH_SQLITE": "ON",
1113
"WITH_BDB": "ON",

ci/test/03_test_script.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then
9999
test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR"
100100
fi
101101

102-
BITCOIN_CONFIG_ALL=""
102+
BITCOIN_CONFIG_ALL="-DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON"
103103
if [ -z "$NO_DEPENDS" ]; then
104104
BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} -DCMAKE_TOOLCHAIN_FILE=$DEPENDS_DIR/$HOST/toolchain.cmake"
105105
fi

0 commit comments

Comments
 (0)