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# Evaluates config-specific generator expressions in a list.8# Recognizable patterns are:9# - $<$<CONFIG:[config]>:[value]>10# - $<$<NOT:$<CONFIG:[config]>>:[value]>11function(evaluate_generator_expressions list config)12set(input ${${list}})13set(result)14foreach(token IN LISTS input)15if(token MATCHES "\\$<\\$<CONFIG:([^>]+)>:([^>]+)>")16if(CMAKE_MATCH_1 STREQUAL config)17list(APPEND result ${CMAKE_MATCH_2})18endif()19elseif(token MATCHES "\\$<\\$<NOT:\\$<CONFIG:([^>]+)>>:([^>]+)>")20if(NOT CMAKE_MATCH_1 STREQUAL config)21list(APPEND result ${CMAKE_MATCH_2})22endif()23else()24list(APPEND result ${token})25endif()26endforeach()27set(${list} ${result} PARENT_SCOPE)28endfunction()31# Gets target's interface properties recursively.32function(get_target_interface var config target property)33get_target_property(result ${target} INTERFACE_${property})34if(result)35evaluate_generator_expressions(result "${config}")36list(JOIN result " " result)37else()38set(result)39endif()41get_target_property(dependencies ${target} INTERFACE_LINK_LIBRARIES)42if(dependencies)43evaluate_generator_expressions(dependencies "${config}")44foreach(dependency IN LISTS dependencies)45if(TARGET ${dependency})46get_target_interface(dep_result "${config}" ${dependency} ${property})47string(STRIP "${result} ${dep_result}" result)48endif()49endforeach()50endif()52set(${var} "${result}" PARENT_SCOPE)53endfunction()
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.