-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] cmake: Build option naming #194
Comments
|
I like the |
I haven't looked into this, and I might have an uninformed or minority opinion, but having I think For example, for multiprocess, there could be For the wallet, there could be For the gui, there could be (I know we don't like having dependencies, so these examples are theoretical, but I think we should still choose a naming convention that can accommodate having dependencies cleanly.) In some of these examples, the features controlled by I also don't like the the convention of having options like Looking at the screenshot in #194 (comment), I think in practice this just means that more variables would get prefixes. This is just my (not completely informed) preference though. There could be things I'm overlooking, and I wouldn't have a problem with a different approach. (EDIT: Changed |
87d3b72 fixup! cmake [KILL 3-STATE]: Make WITH_GUI binary option w/ default OFF (Hennadii Stepanov) Pull request description: Mark `Qt5*_DIR` cache variables as advanced to hide them in the GUI and avoid clutter. See #194. ACKs for top commit: pablomartin4btc: ACK 87d3b72 Tree-SHA512: b4ed70214486919a6a9ac517864ff7c2cd32137bf7a2e116dde8a6b374ea36e3f0e92846accf47ebb5321323cf4c7715ca5751ad562ff42f9362c4b7450191f0
79c3c89 cmake: Group port mapping in summary (Hennadii Stepanov) 18abbb9 cmake: Rework wallet report in summary (Hennadii Stepanov) 7c151e7 cmake: Rename option `WITH_EXTERNAL_SIGNER` to `ENABLE_EXTERNAL_SIGNER` (Hennadii Stepanov) 41a2159 cmake: Rename build option `THREADLOCAL` to `ENABLE_THREADLOCAL` (Hennadii Stepanov) bed5fea cmake: Rename build option `MULTIPROCESS` to `WITH_MULTIPROCESS` (Hennadii Stepanov) 9d6ebf4 cmake: Rename build option `HARDENING` to `ENABLE_HARDENING` (Hennadii Stepanov) 576251f cmake: Rename build option `FUZZ` to `ENABLE_FUZZ` (Hennadii Stepanov) 2a8aba3 cmake: Rename build option `CCACHE` to `WITH_CCACHE` (Hennadii Stepanov) Pull request description: Based on #194 (comment). ### The build option naming convention 1. `BUILD_*` options control what binaries and libraries are built. 2. `ENABLE_*` options control what features are turned on. If a feature is fully implemented in a standalone binary, a `BUILD_*` option should be used. For example, `BUILD_GUI`. 3. `WITH_*` options control what dependencies are turned on (internally, a CMake command `find_*` is used). --- The resulted build option set being presented in the CMake GUI tool looks as follows: ![image](https://github.com/hebasto/bitcoin/assets/32963518/10e3f241-6649-437d-a698-d57ed14501b1) An example of the configure summary: ``` Configure summary ================= Executables: bitcoind ............................ ON bitcoin-node (multiprocess) ......... OFF bitcoin-qt (GUI) .................... OFF bitcoin-gui (GUI, multiprocess) ..... OFF bitcoin-cli ......................... ON bitcoin-tx .......................... ON bitcoin-util ........................ ON bitcoin-wallet ...................... ON bitcoin-chainstate (experimental) ... OFF libbitcoinkernel (experimental) ..... OFF Optional features: wallet support ...................... ON - descriptor wallets (SQLite) ...... ON - legacy wallets (Berkeley DB) ..... OFF external signer ..................... ON port mapping: - using NAT-PMP .................... OFF - using UPnP ....................... OFF ZeroMQ .............................. OFF USDT tracing ........................ OFF QR code (GUI) ....................... OFF DBus (GUI, Linux only) .............. OFF Tests: test_bitcoin ........................ ON test_bitcoin-qt ..................... OFF bench_bitcoin ....................... ON fuzz binary ......................... ON ... ``` Closes #194. Top commit has no ACKs. Tree-SHA512: 21ab517502c11b92e7c173e9390311c470d481fd533671dc9445f4673dfedf76b96ff09dfa52d3c93dcc64e97c561d3ef75c70f7dc0ca513d7d6ff3cfff7368e
Closing as resolved by #198. |
All build options effectively are cache variables, whose values persist across multiple runs within a project build tree.
From the Professional CMake: A Practical Guide 18th Edition:
The current (@ 9857482) build option set being presented in the CMake GUI tool looks as follows:
Please note that selecting the "Grouped" checkbox groups variables together based on the start of the variable name up to the first underscore. CMake reserves names that begin with
CMAKE_
.BUILD_*
options is presented in the "Executables" and "Tests" sections of the "Configure summary".Please note, that CMake's CTest module:
WITH_*
options is presented in the "Wallet support" and "Optionalpackagesfeatures" section of the "Configure summary".However, the
MULTIPROCESS
option has noWITH_
prefix.SECP256K1_*
names.This issue aims to gather suggestions and opinions regarding better naming. Please vote for each suggestion using 👍 for approval and 👎 for disapproval.
The text was updated successfully, but these errors were encountered: