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) 2024-present The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or https://opensource.org/license/mit/.5if("@CMAKE_CXX_COMPILER_ID@" STREQUAL "Clang")6find_program(LLVM_COV_EXECUTABLE llvm-cov REQUIRED)7set(COV_TOOL "${LLVM_COV_EXECUTABLE} gcov")8else()9find_program(GCOV_EXECUTABLE gcov REQUIRED)10set(COV_TOOL "${GCOV_EXECUTABLE}")11endif()13# COV_TOOL is used to replace a placeholder.14configure_file(15${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh.in ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh16FILE_PERMISSIONS OWNER_READ OWNER_EXECUTE17GROUP_READ GROUP_EXECUTE18WORLD_READ19@ONLY20)22find_program(LCOV_EXECUTABLE lcov REQUIRED)23separate_arguments(LCOV_OPTS)24set(LCOV_COMMAND ${LCOV_EXECUTABLE} --gcov-tool ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh ${LCOV_OPTS})26find_program(GENHTML_EXECUTABLE genhtml REQUIRED)27set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${LCOV_OPTS})29find_program(GREP_EXECUTABLE grep REQUIRED)30find_program(AWK_EXECUTABLE awk REQUIRED)32set(LCOV_FILTER_COMMAND ./filter-lcov.py)33list(APPEND LCOV_FILTER_COMMAND -p "/usr/local/")34list(APPEND LCOV_FILTER_COMMAND -p "/usr/include/")35list(APPEND LCOV_FILTER_COMMAND -p "/usr/lib/")36list(APPEND LCOV_FILTER_COMMAND -p "/usr/lib64/")37list(APPEND LCOV_FILTER_COMMAND -p "src/leveldb/")38list(APPEND LCOV_FILTER_COMMAND -p "src/crc32c/")39list(APPEND LCOV_FILTER_COMMAND -p "src/bench/")40list(APPEND LCOV_FILTER_COMMAND -p "src/crypto/ctaes")41list(APPEND LCOV_FILTER_COMMAND -p "src/minisketch")42list(APPEND LCOV_FILTER_COMMAND -p "src/secp256k1")43list(APPEND LCOV_FILTER_COMMAND -p "depends")45execute_process(46COMMAND ${LCOV_COMMAND} --capture --initial --directory src --output-file baseline.info47WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}48COMMAND_ERROR_IS_FATAL ANY49)50execute_process(51COMMAND ${LCOV_FILTER_COMMAND} baseline.info baseline_filtered.info52WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}53COMMAND_ERROR_IS_FATAL ANY54)55execute_process(56COMMAND ${LCOV_COMMAND} --add-tracefile baseline_filtered.info --output-file baseline_filtered.info57WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}58COMMAND_ERROR_IS_FATAL ANY59)
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.