From 69f0d4adb72c1dc5c261517899d87b0fe8b88304 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Mon, 3 Feb 2025 09:28:57 -0500 Subject: [PATCH] scripted-diff: s/WITH_MULTIPROCESS/ENABLE_IPC/ in cmake Rename WITH_MULTIPROCESS to ENABLE_IPC, because ENABLE_IPC is a more accurate name for the feature. It controls whether the src/ipc/ directory is built and whether IPC features like -ipcbind, -ipcconnect, and -ipcfd are available. It does NOT currently enable multiprocess features which are implemented in #10102 building on top of the IPC features. It will also no longer (as of the next commit), control whether a find_package call is made so the "WITH_" prefix is also inappropriate. -BEGIN VERIFY SCRIPT- git grep -l WITH_MULTIPROCESS | xargs sed -i s/WITH_MULTIPROCESS/ENABLE_IPC/g -END VERIFY SCRIPT- --- CMakeLists.txt | 8 ++++---- CMakePresets.json | 2 +- depends/toolchain.cmake.in | 4 ++-- doc/design/libraries.md | 2 +- doc/multiprocess.md | 6 +++--- doc/translation_process.md | 2 +- src/CMakeLists.txt | 6 +++--- src/qt/CMakeLists.txt | 2 +- src/test/CMakeLists.txt | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 006e0cc41b8..c9129b3c1c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,8 +153,8 @@ endif() cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "CMAKE_SYSTEM_NAME STREQUAL \"Linux\" AND BUILD_GUI" OFF) -option(WITH_MULTIPROCESS "Build multiprocess bitcoin-node and bitcoin-gui executables in addition to monolithic bitcoind and bitcoin-qt executables. Requires libmultiprocess library. Experimental." OFF) -if(WITH_MULTIPROCESS) +option(ENABLE_IPC "Build multiprocess bitcoin-node and bitcoin-gui executables in addition to monolithic bitcoind and bitcoin-qt executables. Requires libmultiprocess library. Experimental." OFF) +if(ENABLE_IPC) find_package(Libmultiprocess REQUIRED COMPONENTS Lib) find_package(LibmultiprocessNative REQUIRED COMPONENTS Bin NAMES Libmultiprocess @@ -648,14 +648,14 @@ message("Configure summary") message("=================") message("Executables:") message(" bitcoind ............................ ${BUILD_DAEMON}") -if(BUILD_DAEMON AND WITH_MULTIPROCESS) +if(BUILD_DAEMON AND ENABLE_IPC) set(bitcoin_daemon_status ON) else() set(bitcoin_daemon_status OFF) endif() message(" bitcoin-node (multiprocess) ......... ${bitcoin_daemon_status}") message(" bitcoin-qt (GUI) .................... ${BUILD_GUI}") -if(BUILD_GUI AND WITH_MULTIPROCESS) +if(BUILD_GUI AND ENABLE_IPC) set(bitcoin_gui_status ON) else() set(bitcoin_gui_status OFF) diff --git a/CMakePresets.json b/CMakePresets.json index 31cba7e32f4..f2ea6fd8c86 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -81,7 +81,7 @@ "ENABLE_WALLET": "ON", "WARN_INCOMPATIBLE_BDB": "OFF", "WITH_BDB": "ON", - "WITH_MULTIPROCESS": "ON", + "ENABLE_IPC": "ON", "WITH_QRENCODE": "ON", "WITH_USDT": "ON", "WITH_ZMQ": "ON" diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index 837abe1cd8a..f23fd76c2e6 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -159,9 +159,9 @@ else() endif() if("@multiprocess@" STREQUAL "1") - set(WITH_MULTIPROCESS ON CACHE BOOL "") + set(ENABLE_IPC ON CACHE BOOL "") set(Libmultiprocess_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "") set(LibmultiprocessNative_ROOT "${CMAKE_CURRENT_LIST_DIR}/native" CACHE PATH "") else() - set(WITH_MULTIPROCESS OFF CACHE BOOL "") + set(ENABLE_IPC OFF CACHE BOOL "") endif() diff --git a/doc/design/libraries.md b/doc/design/libraries.md index 7d7228803a6..102b92784c4 100644 --- a/doc/design/libraries.md +++ b/doc/design/libraries.md @@ -8,7 +8,7 @@ | *libbitcoin_crypto* | Hardware-optimized functions for data encryption, hashing, message authentication, and key derivation. | | *libbitcoin_kernel* | Consensus engine and support library used for validation by *libbitcoin_node*. | | *libbitcoinqt* | GUI functionality used by *bitcoin-qt* and *bitcoin-gui* executables. | -| *libbitcoin_ipc* | IPC functionality used by *bitcoin-node*, *bitcoin-wallet*, *bitcoin-gui* executables to communicate when [`-DWITH_MULTIPROCESS=ON`](multiprocess.md) is used. | +| *libbitcoin_ipc* | IPC functionality used by *bitcoin-node*, *bitcoin-wallet*, *bitcoin-gui* executables to communicate when [`-DENABLE_IPC=ON`](multiprocess.md) is used. | | *libbitcoin_node* | P2P and RPC server functionality used by *bitcoind* and *bitcoin-qt* executables. | | *libbitcoin_util* | Home for common functionality shared by different executables and libraries. Similar to *libbitcoin_common*, but lower-level (see [Dependencies](#dependencies)). | | *libbitcoin_wallet* | Wallet functionality used by *bitcoind* and *bitcoin-wallet* executables. | diff --git a/doc/multiprocess.md b/doc/multiprocess.md index 62863c3b230..d98f62de96a 100644 --- a/doc/multiprocess.md +++ b/doc/multiprocess.md @@ -4,7 +4,7 @@ _This document describes usage of the multiprocess feature. For design informati ## Build Option -On Unix systems, the `-DWITH_MULTIPROCESS=ON` build option can be passed to build the supplemental `bitcoin-node` and `bitcoin-gui` multiprocess executables. +On Unix systems, the `-DENABLE_IPC=ON` build option can be passed to build the supplemental `bitcoin-node` and `bitcoin-gui` multiprocess executables. ## Debugging @@ -25,9 +25,9 @@ build/bin/bitcoin-node -regtest -printtoconsole -debug=ipc BITCOIND=$(pwd)/build/bin/bitcoin-node build/test/functional/test_runner.py ``` -The `cmake` build will pick up settings and library locations from the depends directory, so there is no need to pass `-DWITH_MULTIPROCESS=ON` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option). +The `cmake` build will pick up settings and library locations from the depends directory, so there is no need to pass `-DENABLE_IPC=ON` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option). -Alternately, you can install [Cap'n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/bitcoin-core/libmultiprocess) packages on your system, and just run `cmake -B build -DWITH_MULTIPROCESS=ON` without using the depends system. The `cmake` build will be able to locate the installed packages via [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/). See [Installation](https://github.com/bitcoin-core/libmultiprocess/blob/master/doc/install.md) section of the libmultiprocess readme for install steps. See [build-unix.md](build-unix.md) and [build-osx.md](build-osx.md) for information about installing dependencies in general. +Alternately, you can install [Cap'n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/bitcoin-core/libmultiprocess) packages on your system, and just run `cmake -B build -DENABLE_IPC=ON` without using the depends system. The `cmake` build will be able to locate the installed packages via [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/). See [Installation](https://github.com/bitcoin-core/libmultiprocess/blob/master/doc/install.md) section of the libmultiprocess readme for install steps. See [build-unix.md](build-unix.md) and [build-osx.md](build-osx.md) for information about installing dependencies in general. ## Usage diff --git a/doc/translation_process.md b/doc/translation_process.md index 429e92b2b32..a9b2a116fda 100644 --- a/doc/translation_process.md +++ b/doc/translation_process.md @@ -18,7 +18,7 @@ We use automated scripts to help extract translations in both Qt, and non-Qt sou To automatically regenerate the `bitcoin_en.ts` file, run the following commands: ```sh -cmake --preset dev-mode -DWITH_USDT=OFF -DWITH_MULTIPROCESS=OFF +cmake --preset dev-mode -DWITH_USDT=OFF -DENABLE_IPC=OFF cmake --build build_dev_mode --target translate ``` diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e9a67faa51a..b145f830f0d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -96,7 +96,7 @@ add_dependencies(bitcoin_clientversion generate_build_info) add_subdirectory(crypto) add_subdirectory(util) -if(WITH_MULTIPROCESS) +if(ENABLE_IPC) add_subdirectory(ipc) endif() @@ -342,7 +342,7 @@ if(BUILD_DAEMON) ) install_binary_component(bitcoind HAS_MANPAGE) endif() -if(WITH_MULTIPROCESS AND BUILD_DAEMON) +if(ENABLE_IPC AND BUILD_DAEMON) add_executable(bitcoin-node bitcoind.cpp init/bitcoin-node.cpp @@ -356,7 +356,7 @@ if(WITH_MULTIPROCESS AND BUILD_DAEMON) install_binary_component(bitcoin-node) endif() -if(WITH_MULTIPROCESS AND BUILD_TESTS) +if(ENABLE_IPC AND BUILD_TESTS) # bitcoin_ipc_test library target is defined here in src/CMakeLists.txt # instead of src/test/CMakeLists.txt so capnp files in src/test/ are able to # reference capnp files in src/ipc/capnp/ by relative path. The Cap'n Proto diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index fe311bb062c..7379a1f328e 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -269,7 +269,7 @@ if(WIN32) set_target_properties(bitcoin-qt PROPERTIES WIN32_EXECUTABLE TRUE) endif() -if(WITH_MULTIPROCESS) +if(ENABLE_IPC) add_executable(bitcoin-gui main.cpp ../init/bitcoin-gui.cpp diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 336377331d9..6a36abb16f9 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -157,7 +157,7 @@ if(ENABLE_WALLET) add_subdirectory(${PROJECT_SOURCE_DIR}/src/wallet/test wallet) endif() -if(WITH_MULTIPROCESS) +if(ENABLE_IPC) target_link_libraries(bitcoin_ipc_test PRIVATE core_interface