Skip to content

Commit 8652893

Browse files
committed
Merge bitcoin/bitcoin#31834: build: disable bitcoin-node if daemon is not built
2ffea09 build: disable bitcoin-node if daemon is not built (Sjors Provoost) Pull request description: When building for fuzzing with multiprocess enabled, we were still trying to build `bitcoin-node`. This PR fixes that, by applying a similar check as for `bitcoin-gui`. Before: ``` cmake -B build -DBUILD_FOR_FUZZING=ON -DWITH_MULTIPROCESS=ON ... Configure summary ================= Executables: bitcoind ............................ OFF bitcoin-node (multiprocess) ......... ON bitcoin-qt (GUI) .................... OFF bitcoin-gui (GUI, multiprocess) ..... OFF ... cmake --build build ... [ 84%] Built target bitcoin-node ``` After: ``` bitcoin-node (multiprocess) ......... OFF ``` And no `bitcoin-node` target gets built (not to be confused with `bitcoin_node`). ACKs for top commit: hebasto: ACK 2ffea09. ryanofsky: Code review ACK 2ffea09 laanwj: Code review ACK 2ffea09 Tree-SHA512: bdb0b62049f77929d5c084bf98a076e9933de91eb30853ed89edd23cc81b3d4aec4cd57c9a9e21cf1d6930885f8c408dda830db6884b4e326c7fb348f1fbab4c
2 parents 2507ebd + 2ffea09 commit 8652893

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,12 @@ message("Configure summary")
609609
message("=================")
610610
message("Executables:")
611611
message(" bitcoind ............................ ${BUILD_DAEMON}")
612-
message(" bitcoin-node (multiprocess) ......... ${WITH_MULTIPROCESS}")
612+
if(BUILD_DAEMON AND WITH_MULTIPROCESS)
613+
set(bitcoin_daemon_status ON)
614+
else()
615+
set(bitcoin_daemon_status OFF)
616+
endif()
617+
message(" bitcoin-node (multiprocess) ......... ${bitcoin_daemon_status}")
613618
message(" bitcoin-qt (GUI) .................... ${BUILD_GUI}")
614619
if(BUILD_GUI AND WITH_MULTIPROCESS)
615620
set(bitcoin_gui_status ON)

src/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ if(BUILD_DAEMON)
320320
)
321321
list(APPEND installable_targets bitcoind)
322322
endif()
323-
if(WITH_MULTIPROCESS)
323+
if(WITH_MULTIPROCESS AND BUILD_DAEMON)
324324
add_executable(bitcoin-node
325325
bitcoind.cpp
326326
init/bitcoin-node.cpp
@@ -332,8 +332,9 @@ if(WITH_MULTIPROCESS)
332332
$<TARGET_NAME_IF_EXISTS:bitcoin_wallet>
333333
)
334334
list(APPEND installable_targets bitcoin-node)
335+
endif()
335336

336-
if(BUILD_TESTS)
337+
if(WITH_MULTIPROCESS AND BUILD_TESTS)
337338
# bitcoin_ipc_test library target is defined here in src/CMakeLists.txt
338339
# instead of src/test/CMakeLists.txt so capnp files in src/test/ are able to
339340
# reference capnp files in src/ipc/capnp/ by relative path. The Cap'n Proto
@@ -347,7 +348,6 @@ if(WITH_MULTIPROCESS)
347348
test/ipc_test.capnp
348349
)
349350
add_dependencies(bitcoin_ipc_test bitcoin_ipc_headers)
350-
endif()
351351
endif()
352352

353353

0 commit comments

Comments
 (0)