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.
1if(CMAKE_HOST_APPLE)2find_program(BREW_COMMAND brew)3execute_process(4COMMAND ${BREW_COMMAND} --prefix valgrind5OUTPUT_VARIABLE valgrind_brew_prefix6ERROR_QUIET7OUTPUT_STRIP_TRAILING_WHITESPACE8)9endif()11set(hints_paths)12if(valgrind_brew_prefix)13set(hints_paths ${valgrind_brew_prefix}/include)14endif()16find_path(Valgrind_INCLUDE_DIR17NAMES valgrind/memcheck.h18HINTS ${hints_paths}19)21if(Valgrind_INCLUDE_DIR)22include(CheckCSourceCompiles)23set(CMAKE_REQUIRED_INCLUDES ${Valgrind_INCLUDE_DIR})24check_c_source_compiles("25#include <valgrind/memcheck.h>26#if defined(NVALGRIND)27# error \"Valgrind does not support this platform.\"28#endif30int main() {}31" Valgrind_WORKS)32endif()34include(FindPackageHandleStandardArgs)35find_package_handle_standard_args(Valgrind36REQUIRED_VARS Valgrind_INCLUDE_DIR Valgrind_WORKS37)39mark_as_advanced(40Valgrind_INCLUDE_DIR41)
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.