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/.5include_guard(GLOBAL)7function(check_linker_supports_pie warnings)8# Workaround for a bug in the check_pie_supported() function.9# See:10# - https://gitlab.kitware.com/cmake/cmake/-/issues/2646311# - https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1003412if(CMAKE_VERSION VERSION_LESS 3.32)13# CMAKE_CXX_COMPILE_OPTIONS_PIE is a list, whereas CMAKE_REQUIRED_FLAGS14# must be a string. Therefore, a proper conversion is required.15list(JOIN CMAKE_CXX_COMPILE_OPTIONS_PIE " " CMAKE_REQUIRED_FLAGS)16endif()18include(CheckPIESupported)19check_pie_supported(OUTPUT_VARIABLE output LANGUAGES CXX)20if(CMAKE_CXX_LINK_PIE_SUPPORTED)21set(CMAKE_POSITION_INDEPENDENT_CODE ON PARENT_SCOPE)22elseif(NOT WIN32)23# The warning is superfluous for Windows.24message(WARNING "PIE is not supported at link time. See the configure log for details.")25set(${warnings} ${${warnings}} "Position independent code disabled." PARENT_SCOPE)26endif()27endfunction()
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.