Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# Copyright (c) 2024-present The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or https://opensource.org/license/mit/.5include(GNUInstallDirs)7# TODO: libbitcoinkernel is a work in progress consensus engine8# library, as more and more modules are decoupled from the9# consensus engine, this list will shrink to only those10# which are absolutely necessary.11add_library(bitcoinkernel12bitcoinkernel.cpp13chain.cpp14checks.cpp15chainparams.cpp16coinstats.cpp17context.cpp18cs_main.cpp19disconnected_transactions.cpp20mempool_removal_reason.cpp21../arith_uint256.cpp22../chain.cpp23../coins.cpp24../compressor.cpp25../consensus/merkle.cpp26../consensus/tx_check.cpp27../consensus/tx_verify.cpp28../dbwrapper.cpp29../deploymentinfo.cpp30../deploymentstatus.cpp31../flatfile.cpp32../hash.cpp33../logging.cpp34../node/blockstorage.cpp35../node/chainstate.cpp36../node/utxo_snapshot.cpp37../policy/ephemeral_policy.cpp38../policy/feerate.cpp39../policy/packages.cpp40../policy/policy.cpp41../policy/rbf.cpp42../policy/settings.cpp43../policy/truc_policy.cpp44../pow.cpp45../primitives/block.cpp46../primitives/transaction.cpp47../pubkey.cpp48../random.cpp49../randomenv.cpp50../script/interpreter.cpp51../script/script.cpp52../script/script_error.cpp53../script/sigcache.cpp54../script/solver.cpp55../signet.cpp56../streams.cpp57../sync.cpp58../txdb.cpp59../txgraph.cpp60../txmempool.cpp61../uint256.cpp62../util/chaintype.cpp63../util/check.cpp64../util/exception.cpp65../util/expected.cpp66../util/feefrac.cpp67../util/fs.cpp68../util/fs_helpers.cpp69../util/hasher.cpp70../util/moneystr.cpp71../util/rbf.cpp72../util/signalinterrupt.cpp73../util/syserror.cpp74../util/thread.cpp75../util/threadnames.cpp76../util/time.cpp77../util/tokenpipe.cpp78../validation.cpp79../validationinterface.cpp80../versionbits.cpp81$<TARGET_OBJECTS:bitcoin_clientversion>82$<TARGET_OBJECTS:bitcoin_crypto>83$<TARGET_OBJECTS:leveldb>84$<TARGET_OBJECTS:crc32c>85)87# Compiler warnings that apply only to the kernel and its dependencies.88# These can be more strict and/or warnings that only apply to shared89# libs.90add_library(kernel_warn_interface INTERFACE)91if(NOT MSVC)92try_append_cxx_flags("-Wunique-object-duplication" TARGET kernel_warn_interface SKIP_LINK)93endif()95# Also manually apply the warnings to the kernel's internal dependencies96target_link_libraries(bitcoin_clientversion PRIVATE kernel_warn_interface)97target_link_libraries(bitcoin_crypto PRIVATE kernel_warn_interface)98target_link_libraries(leveldb PRIVATE kernel_warn_interface)99target_link_libraries(crc32c PRIVATE kernel_warn_interface)101target_link_libraries(bitcoinkernel102PRIVATE103core_interface104kernel_warn_interface105secp256k1_objs106$<$<PLATFORM_ID:Windows>:bcrypt>107$<TARGET_NAME_IF_EXISTS:USDT::headers>108Boost::headers109)111target_include_directories(bitcoinkernel PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/leveldb/include>)113# Add a convenience libbitcoinkernel target as a synonym for bitcoinkernel.114add_custom_target(libbitcoinkernel)115add_dependencies(libbitcoinkernel bitcoinkernel)117get_target_property(bitcoinkernel_type bitcoinkernel TYPE)118if(bitcoinkernel_type STREQUAL "STATIC_LIBRARY")119target_compile_definitions(bitcoinkernel PUBLIC BITCOINKERNEL_STATIC)120endif()122configure_file(${PROJECT_SOURCE_DIR}/libbitcoinkernel.pc.in ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc @ONLY)123install(FILES ${PROJECT_BINARY_DIR}/libbitcoinkernel.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" COMPONENT libbitcoinkernel)125install(TARGETS bitcoinkernel126RUNTIME127DESTINATION ${CMAKE_INSTALL_BINDIR}128COMPONENT libbitcoinkernel129LIBRARY130DESTINATION ${CMAKE_INSTALL_LIBDIR}131COMPONENT libbitcoinkernel132ARCHIVE133DESTINATION ${CMAKE_INSTALL_LIBDIR}134COMPONENT libbitcoinkernel135)137install(FILES bitcoinkernel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT libbitcoinkernel)
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.