Page MenuHomePhabricator

[cmake] deprecate BUILD_BITCOIN_X flags in favor of BUILD_X flags
ClosedPublic

Authored by PiRK on Jun 9 2025, 19:10.

Details

Summary

This change will make it easier to manually type cmake commands. The old flags are still supported for now, but a deprecation warning is printed. And if both an old and new flas are set and are not identical, the build with error.

The BUILD_BITCOIN_X flag made sense for some features that result in a bitcoin-x executable being generated, but it wasn't used consistently only for this particular scenario. For instance there is no bitcoin-chronik or bitcoin-zmq executable. Also we use the same flag BUILD_BITCOIN_WALLET both for enabling the wallet feature in bitcoind and for selecting the bitcoin-wallet.

Test Plan

Succeeds:

cmake .. -GNinja
cmake .. -GNinja -DBUILD_CHRONIK=1

Succeeds with a warning:

cmake .. -GNinja -DBUILD_BITCOIN_CHRONIK=1
cmake .. -GNinja  -DBUILD_BITCOIN_CHRONIK=ON -DBUILD_CHRONIK=ON

Fails:

cmake .. -GNinja  -DBUILD_BITCOIN_CHRONIK=1 -DBUILD_CHRONIK=0

check all the CI build configurations

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

@bot guix-linux guix-osx guix-win

PiRK published this revision for review.Jun 10 2025, 09:37

most of the diff is just semi-automatic text replacement : all BUILD_BITCOIN_ patterns relplace by BUILD_ except for BUILD_BITCOIN_INTERNAL which is untouched

The interesting code to review is:

  • cmake/modules/Deprecation.cmake (new cmake macro)
  • CMakeLists.txt (deprecation of BUILD_BITCOIN_CHRONIK[_PLUGINS]
  • src/CMakeLists.txt (deprecation of all the other ones)
This revision is now accepted and ready to land.Jun 10 2025, 13:17
This revision was landed with ongoing or failed builds.Jun 10 2025, 16:05
This revision was automatically updated to reflect the committed changes.