[WIP] build: Add CMake-based build system #25305

pull hebasto wants to merge 20 commits into bitcoin:master from hebasto:cmake/pr changing 15 files +1061 −3
  1. hebasto commented at 10:09 AM on June 8, 2022: member

    Done:

    • bitcoind executable, could be disabled with -DBUILD_DAEMON=OFF
    • bitcoin-cli executable, could be disabled with -DBUILD_CLI=OFF
    • libbitcoinconsensus shared library, could be disabled with -DBUILD_BITCOINCONSENSUS_LIB=OFF
    • libbitcoinkernel shared library, could be disabled with -DBUILD_BITCOINKERNEL_LIB=OFF
    • wallet support (SQLite, not BDB), could be disabled with -DENABLE_WALLET=OFF
    • ccache support, could be disabled with -DUSE_CCACHE=OFF
    • cross-compiling, including Windows builds with DEBUG=1
    • reduce exported symbols support, could be enabled with -DREDUCE_EXPORTS=ON (broken on macOS yet)

    Not implemented yet:

    • optional package support
    • BDB wallet support
    • ...

    Need to be fixed:

    • -DREDUCE_EXPORTS=ON on macOS

    A benefit to note -- cross compiling libbitcoinconsensus.dll with DEBUG=1 just works (see #19772)

    Native compiling has been tested on the following OSes:

    • Ubuntu 22.04
    • macOS Monterey
    • FreeBSD 12.3
    rm -rf build && cmake -S . -B build
    cmake --build build
    
    • OpenBSD 7.1
    rm -rf build && cmake -DCMAKE_MAKE_PROGRAM=gmake -S . -B build
    cmake --build build
    

    Cross compiling for Windows on Ubuntu 22.04

    make -j$(nproc) -C depends HOST=x86_64-w64-mingw32 NO_QT=1
    rm -rf build && cmake -C $PWD/depends/x86_64-w64-mingw32/share/depends.cmake -S . -B build
    cmake --build build -j$(nproc)
    

    Cross compiling for macOS on Ubuntu 22.04

    make -j$(nproc) -C depends HOST=x86_64-apple-darwin NO_QT=1
    rm -rf build && cmake -C $PWD/depends/x86_64-apple-darwin/share/depends.cmake -S . -B build
    cmake --build build -j$(nproc)
    
  2. cmake: Add root `CMakeLists.txt` file 306ce82ea8
  3. cmake: Integrate `ccache` 72930dc50c
  4. cmake: Add `cmake/subtree-crc32c.cmake` file 53aaab6737
  5. cmake: Add `cmake/subtree-leveldb.cmake` file 7ae4efbac5
  6. cmake: Add `cmake/subtree-minisketch.cmake` file 8ba226291a
  7. cmake: Add `cmake/subtree-univalue.cmake` file 01c435d316
  8. cmake: Add `cmake/subtree-secp256k1.cmake` file 6fd7778627
  9. cmake: Build `bitcoin_common` static library 1309398e12
  10. cmake: Build `bitcoin_crypto` static library ecc8dc5a99
  11. cmake: Build `bitcoin_util` static library 4fc3594edd
  12. cmake: Build `bitcoin_consensus` library 706cbad8e9
  13. cmake: Build `bitcoin_node` static library ebf42be994
  14. build: Create `share/depends.cmake` initial cache file bfbacf0e08
  15. cmake: Use `share/depends.cmake` initial cache file for cross-compiling 8427ae45d4
  16. cmake: Build `bitcoind` executable 7dd297e7e5
  17. cmake: Build `bitcoin-cli` executable cd186a0888
  18. [FIXME] cmake: Build shared `libbitcoinconsensus` library 328c0e7c45
  19. cmake: Build shared `libbitcoinkernel` library 4d54350d5c
  20. cmake: Add `REDUCE_EXPORTS` option 4b2ffe817f
  21. cmake: Build `bitcoin_wallet` static library 6a7943a9e1
  22. hebasto closed this on Jun 8, 2022

  23. fanquake locked this on Jun 12, 2022
  24. hebasto commented at 9:17 AM on June 20, 2022: member

    @luke-jr on IRC:

    might be nice if the Core PR had a link to the current one so others can find it

    Here the link: https://github.com/hebasto/bitcoin/pull/3


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me