Inside Bitcoin
Opening the selected file…
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) 2023-present The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or https://opensource.org/license/mit/.5include_guard(GLOBAL)7# Avoid the directory-wide add_definitions() and add_compile_definitions() commands.8# Instead, prefer the target-specific target_compile_definitions() one.9get_directory_property(global_compile_definitions COMPILE_DEFINITIONS)10if(global_compile_definitions)11message(AUTHOR_WARNING "The directory's COMPILE_DEFINITIONS property is not empty: ${global_compile_definitions}")12endif()14# Avoid the directory-wide add_compile_options() command.15# Instead, prefer the target-specific target_compile_options() one.16get_directory_property(global_compile_options COMPILE_OPTIONS)17if(global_compile_options)18message(AUTHOR_WARNING "The directory's COMPILE_OPTIONS property is not empty: ${global_compile_options}")19endif()21# Avoid the directory-wide add_link_options() command.22# Instead, prefer the target-specific target_link_options() one.23get_directory_property(global_link_options LINK_OPTIONS)24if(global_link_options)25message(AUTHOR_WARNING "The directory's LINK_OPTIONS property is not empty: ${global_link_options}")26endif()28# Avoid the directory-wide link_libraries() command.29# Instead, prefer the target-specific target_link_libraries() one.30file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy_cxx_source.cpp "#error")31add_library(check_loose_linked_libraries OBJECT EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/dummy_cxx_source.cpp)32set_target_properties(check_loose_linked_libraries PROPERTIES EXPORT_COMPILE_COMMANDS OFF)33get_target_property(global_linked_libraries check_loose_linked_libraries LINK_LIBRARIES)34if(global_linked_libraries)35message(AUTHOR_WARNING "There are libraries linked with `link_libraries` commands: ${global_linked_libraries}")36endif()
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.