Inside Bitcoin
Opening the selected file…
Inside Bitcoin
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.
1include(CheckCCompilerFlag)3function(secp256k1_check_c_flags_internal flags output)4string(MAKE_C_IDENTIFIER "${flags}" result)5string(TOUPPER "${result}" result)6set(result "C_SUPPORTS_${result}")7if(NOT MSVC)8set(CMAKE_REQUIRED_FLAGS "-Werror")9endif()11# This avoids running a linker.12set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)13check_c_compiler_flag("${flags}" ${result})15set(${output} ${${result}} PARENT_SCOPE)16endfunction()18# Append flags to the COMPILE_OPTIONS directory property if CC accepts them.19macro(try_append_c_flags)20secp256k1_check_c_flags_internal("${ARGV}" result)21if(result)22add_compile_options(${ARGV})23endif()24endmacro()
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.