Description
This issue will be updated to reflect the current state of CMake integration.
A brief historical context:
- build: Add CMake-based build system #25797 proposed a CMake-based build system with 100% feature parity to the Autotools-based one.
- The reviewing process is happening in this repo as suggested in build: Add CMake-based build system (1 of N) #27060 (comment).
- The recent discussion at CoreDev -- https://btctranscripts.com/bitcoin-core-dev-tech/2023-09/cmake/
How reviewing happens:
- Pull requests are opened against the https://github.com/hebasto/bitcoin/tree/cmake-staging branch.
- After reviewing and merging them, the staging branch get synced with the main branch from this repo.
- This loop continues until all commits from build: Add CMake-based build system #25797 get reviewed.
The planned chunks of work:
- The root
CMakeLists.txt
andconfig/bitcoin-config.h
files -- build: Add CMake-based build system (1 of N) hebasto/bitcoin#5 - Project-wide system introspections; the
leveldb
build target -- build: Add CMake-based build system (2 of N) hebasto/bitcoin#6 - The
bitcoind
build target -- build: Add CMake-based build system (3 of N) hebasto/bitcoin#7 - Cross-compiling support -- build: Add CMake-based build system (4 of N) hebasto/bitcoin#10
- Ccache support;
libnatpmp
,libminiupnpc
,libzmq
andsystemtap-sdt
optional packages support -- build: Add CMake-based build system (5 of N) hebasto/bitcoin#13 - Utility binaries, wallet functionality,
bench_bitcoin
andtest_bitcoin
-- build: Add CMake-based build system (6 of N) hebasto/bitcoin#15 - Handling different build configurations -- build: Add CMake-based build system (8 of N) hebasto/bitcoin#18
- Hardening, shared libraries -- cmake: Add hardening, reduce exports, werror and install hebasto/bitcoin#32
BuildSee RFC: Deprecate libconsensus #29189libbitcoinconsensus
library -- cmake: Buildlibbitcoinconsensus
library hebasto/bitcoin#41- Qt stuff -- cmake: Build
bitcoin-qt
executable hebasto/bitcoin#77 - Guix builds -- cmake: Migrate Guix build scripts to CMake hebasto/bitcoin#67
- Building for fuzzing -- cmake: Add fuzzing facilities hebasto/bitcoin#43
- multiprocess support -- cmake: Add
MULTIPROCESS
option hebasto/bitcoin#118 -
libbitcoin-kernel
andbitcoin-chainstate
-- cmake: Buildlibbitcoinkernel
andbitcoin-chainstate
hebasto/bitcoin#134 - CI stuff -- ci: Migrate CI scripts to CMake hebasto/bitcoin#142
Building for AndroidSee build, test, doc: Temporarily remove Android-related stuff #30049
The current minimum required CMake version is 3.13, which is the system package on Debian 10. Considering the timings of Debian 10 LTS EOL and integrating CMake into this repo, it seems reasonable to bump the minimum supported version up to 3.16, which is the system package on Ubuntu 20.04 LTS.
- Bump minimum supported CMake version from 3.13 up to 3.16 -- Bump minimum CMake version up to 3.16 hebasto/bitcoin#33
To hold the 100% feature parity, the current CMake-based build system implementation can autodetect an optional package and enable it as Autotools-based one does. However, it was suggested to make all optional package opt-in by default. See:
-
build: Add CMake-based build system (5 of N) hebasto/bitcoin#12 (comment)
-
build: Add CMake-based build system (5 of N) hebasto/bitcoin#12 (comment)
-
build: Add CMake-based build system (5 of N) hebasto/bitcoin#13 (comment)
-
Make all optional package opt-in by default
Autotools vs CMake Feature Parity Table is available here.
To list CMake's options, one might add the -LH
option during configuring step.
Updated build docs: