github.com/ethereum/go-ethereum@v1.16.1/crypto/secp256k1/libsecp256k1/CMakeLists.txt (about)

     1  cmake_minimum_required(VERSION 3.16)
     2  
     3  #=============================
     4  # Project / Package metadata
     5  #=============================
     6  project(libsecp256k1
     7    # The package (a.k.a. release) version is based on semantic versioning 2.0.0 of
     8    # the API. All changes in experimental modules are treated as
     9    # backwards-compatible and therefore at most increase the minor version.
    10    VERSION 0.6.1
    11    DESCRIPTION "Optimized C library for ECDSA signatures and secret/public key operations on curve secp256k1."
    12    HOMEPAGE_URL "https://github.com/bitcoin-core/secp256k1"
    13    LANGUAGES C
    14  )
    15  enable_testing()
    16  list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
    17  
    18  if(CMAKE_VERSION VERSION_LESS 3.21)
    19    # Emulates CMake 3.21+ behavior.
    20    if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
    21      set(PROJECT_IS_TOP_LEVEL ON)
    22      set(${PROJECT_NAME}_IS_TOP_LEVEL ON)
    23    else()
    24      set(PROJECT_IS_TOP_LEVEL OFF)
    25      set(${PROJECT_NAME}_IS_TOP_LEVEL OFF)
    26    endif()
    27  endif()
    28  
    29  # The library version is based on libtool versioning of the ABI. The set of
    30  # rules for updating the version can be found here:
    31  # https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
    32  # All changes in experimental modules are treated as if they don't affect the
    33  # interface and therefore only increase the revision.
    34  set(${PROJECT_NAME}_LIB_VERSION_CURRENT 5)
    35  set(${PROJECT_NAME}_LIB_VERSION_REVISION 1)
    36  set(${PROJECT_NAME}_LIB_VERSION_AGE 0)
    37  
    38  #=============================
    39  # Language setup
    40  #=============================
    41  set(CMAKE_C_STANDARD 90)
    42  set(CMAKE_C_EXTENSIONS OFF)
    43  
    44  #=============================
    45  # Configurable options
    46  #=============================
    47  option(BUILD_SHARED_LIBS "Build shared libraries." ON)
    48  option(SECP256K1_DISABLE_SHARED "Disable shared library. Overrides BUILD_SHARED_LIBS." OFF)
    49  if(SECP256K1_DISABLE_SHARED)
    50    set(BUILD_SHARED_LIBS OFF)
    51  endif()
    52  
    53  option(SECP256K1_INSTALL "Enable installation." ${PROJECT_IS_TOP_LEVEL})
    54  
    55  ## Modules
    56  
    57  # We declare all options before processing them, to make sure we can express
    58  # dependencies while processing.
    59  option(SECP256K1_ENABLE_MODULE_ECDH "Enable ECDH module." ON)
    60  option(SECP256K1_ENABLE_MODULE_RECOVERY "Enable ECDSA pubkey recovery module." OFF)
    61  option(SECP256K1_ENABLE_MODULE_EXTRAKEYS "Enable extrakeys module." ON)
    62  option(SECP256K1_ENABLE_MODULE_SCHNORRSIG "Enable schnorrsig module." ON)
    63  option(SECP256K1_ENABLE_MODULE_MUSIG "Enable musig module." ON)
    64  option(SECP256K1_ENABLE_MODULE_ELLSWIFT "Enable ElligatorSwift module." ON)
    65  
    66  # Processing must be done in a topological sorting of the dependency graph
    67  # (dependent module first).
    68  if(SECP256K1_ENABLE_MODULE_ELLSWIFT)
    69    add_compile_definitions(ENABLE_MODULE_ELLSWIFT=1)
    70  endif()
    71  
    72  if(SECP256K1_ENABLE_MODULE_MUSIG)
    73    if(DEFINED SECP256K1_ENABLE_MODULE_SCHNORRSIG AND NOT SECP256K1_ENABLE_MODULE_SCHNORRSIG)
    74      message(FATAL_ERROR "Module dependency error: You have disabled the schnorrsig module explicitly, but it is required by the musig module.")
    75    endif()
    76    set(SECP256K1_ENABLE_MODULE_SCHNORRSIG ON)
    77    add_compile_definitions(ENABLE_MODULE_MUSIG=1)
    78  endif()
    79  
    80  if(SECP256K1_ENABLE_MODULE_SCHNORRSIG)
    81    if(DEFINED SECP256K1_ENABLE_MODULE_EXTRAKEYS AND NOT SECP256K1_ENABLE_MODULE_EXTRAKEYS)
    82      message(FATAL_ERROR "Module dependency error: You have disabled the extrakeys module explicitly, but it is required by the schnorrsig module.")
    83    endif()
    84    set(SECP256K1_ENABLE_MODULE_EXTRAKEYS ON)
    85    add_compile_definitions(ENABLE_MODULE_SCHNORRSIG=1)
    86  endif()
    87  
    88  if(SECP256K1_ENABLE_MODULE_EXTRAKEYS)
    89    add_compile_definitions(ENABLE_MODULE_EXTRAKEYS=1)
    90  endif()
    91  
    92  if(SECP256K1_ENABLE_MODULE_RECOVERY)
    93    add_compile_definitions(ENABLE_MODULE_RECOVERY=1)
    94  endif()
    95  
    96  if(SECP256K1_ENABLE_MODULE_ECDH)
    97    add_compile_definitions(ENABLE_MODULE_ECDH=1)
    98  endif()
    99  
   100  option(SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS "Enable external default callback functions." OFF)
   101  if(SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS)
   102    add_compile_definitions(USE_EXTERNAL_DEFAULT_CALLBACKS=1)
   103  endif()
   104  
   105  set(SECP256K1_ECMULT_WINDOW_SIZE 15 CACHE STRING "Window size for ecmult precomputation for verification, specified as integer in range [2..24]. The default value is a reasonable setting for desktop machines (currently 15). [default=15]")
   106  set_property(CACHE SECP256K1_ECMULT_WINDOW_SIZE PROPERTY STRINGS 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24)
   107  include(CheckStringOptionValue)
   108  check_string_option_value(SECP256K1_ECMULT_WINDOW_SIZE)
   109  add_compile_definitions(ECMULT_WINDOW_SIZE=${SECP256K1_ECMULT_WINDOW_SIZE})
   110  
   111  set(SECP256K1_ECMULT_GEN_KB 86 CACHE STRING "The size of the precomputed table for signing in multiples of 1024 bytes (on typical platforms). Larger values result in possibly better signing or key generation performance at the cost of a larger table. Valid choices are 2, 22, 86. The default value is a reasonable setting for desktop machines (currently 86). [default=86]")
   112  set_property(CACHE SECP256K1_ECMULT_GEN_KB PROPERTY STRINGS 2 22 86)
   113  check_string_option_value(SECP256K1_ECMULT_GEN_KB)
   114  if(SECP256K1_ECMULT_GEN_KB EQUAL 2)
   115    add_compile_definitions(COMB_BLOCKS=2)
   116    add_compile_definitions(COMB_TEETH=5)
   117  elseif(SECP256K1_ECMULT_GEN_KB EQUAL 22)
   118    add_compile_definitions(COMB_BLOCKS=11)
   119    add_compile_definitions(COMB_TEETH=6)
   120  elseif(SECP256K1_ECMULT_GEN_KB EQUAL 86)
   121    add_compile_definitions(COMB_BLOCKS=43)
   122    add_compile_definitions(COMB_TEETH=6)
   123  endif()
   124  
   125  set(SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY "OFF" CACHE STRING "Test-only override of the (autodetected by the C code) \"widemul\" setting. Legal values are: \"OFF\", \"int128_struct\", \"int128\" or \"int64\". [default=OFF]")
   126  set_property(CACHE SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY PROPERTY STRINGS "OFF" "int128_struct" "int128" "int64")
   127  check_string_option_value(SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
   128  if(SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
   129    string(TOUPPER "${SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY}" widemul_upper_value)
   130    add_compile_definitions(USE_FORCE_WIDEMUL_${widemul_upper_value}=1)
   131  endif()
   132  mark_as_advanced(FORCE SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
   133  
   134  set(SECP256K1_ASM "AUTO" CACHE STRING "Assembly to use: \"AUTO\", \"OFF\", \"x86_64\" or \"arm32\" (experimental). [default=AUTO]")
   135  set_property(CACHE SECP256K1_ASM PROPERTY STRINGS "AUTO" "OFF" "x86_64" "arm32")
   136  check_string_option_value(SECP256K1_ASM)
   137  if(SECP256K1_ASM STREQUAL "arm32")
   138    enable_language(ASM)
   139    include(CheckArm32Assembly)
   140    check_arm32_assembly()
   141    if(HAVE_ARM32_ASM)
   142      add_compile_definitions(USE_EXTERNAL_ASM=1)
   143    else()
   144      message(FATAL_ERROR "ARM32 assembly requested but not available.")
   145    endif()
   146  elseif(SECP256K1_ASM)
   147    include(CheckX86_64Assembly)
   148    check_x86_64_assembly()
   149    if(HAVE_X86_64_ASM)
   150      set(SECP256K1_ASM "x86_64")
   151      add_compile_definitions(USE_ASM_X86_64=1)
   152    elseif(SECP256K1_ASM STREQUAL "AUTO")
   153      set(SECP256K1_ASM "OFF")
   154    else()
   155      message(FATAL_ERROR "x86_64 assembly requested but not available.")
   156    endif()
   157  endif()
   158  
   159  option(SECP256K1_EXPERIMENTAL "Allow experimental configuration options." OFF)
   160  if(NOT SECP256K1_EXPERIMENTAL)
   161    if(SECP256K1_ASM STREQUAL "arm32")
   162      message(FATAL_ERROR "ARM32 assembly is experimental. Use -DSECP256K1_EXPERIMENTAL=ON to allow.")
   163    endif()
   164  endif()
   165  
   166  set(SECP256K1_VALGRIND "AUTO" CACHE STRING "Build with extra checks for running inside Valgrind. [default=AUTO]")
   167  set_property(CACHE SECP256K1_VALGRIND PROPERTY STRINGS "AUTO" "OFF" "ON")
   168  check_string_option_value(SECP256K1_VALGRIND)
   169  if(SECP256K1_VALGRIND)
   170    find_package(Valgrind MODULE)
   171    if(Valgrind_FOUND)
   172      set(SECP256K1_VALGRIND ON)
   173      include_directories(${Valgrind_INCLUDE_DIR})
   174      add_compile_definitions(VALGRIND)
   175    elseif(SECP256K1_VALGRIND STREQUAL "AUTO")
   176      set(SECP256K1_VALGRIND OFF)
   177    else()
   178      message(FATAL_ERROR "Valgrind support requested but valgrind/memcheck.h header not available.")
   179    endif()
   180  endif()
   181  
   182  option(SECP256K1_BUILD_BENCHMARK "Build benchmarks." ON)
   183  option(SECP256K1_BUILD_TESTS "Build tests." ON)
   184  option(SECP256K1_BUILD_EXHAUSTIVE_TESTS "Build exhaustive tests." ON)
   185  option(SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." ${SECP256K1_VALGRIND})
   186  option(SECP256K1_BUILD_EXAMPLES "Build examples." OFF)
   187  
   188  # Redefine configuration flags.
   189  # We leave assertions on, because they are only used in the examples, and we want them always on there.
   190  if(MSVC)
   191    string(REGEX REPLACE "/DNDEBUG[ \t\r\n]*" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
   192    string(REGEX REPLACE "/DNDEBUG[ \t\r\n]*" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
   193    string(REGEX REPLACE "/DNDEBUG[ \t\r\n]*" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
   194  else()
   195    string(REGEX REPLACE "-DNDEBUG[ \t\r\n]*" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
   196    string(REGEX REPLACE "-DNDEBUG[ \t\r\n]*" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
   197    string(REGEX REPLACE "-DNDEBUG[ \t\r\n]*" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
   198    # Prefer -O2 optimization level. (-O3 is CMake's default for Release for many compilers.)
   199    string(REGEX REPLACE "-O3( |$)" "-O2\\1" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
   200  endif()
   201  
   202  # Define custom "Coverage" build type.
   203  set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O0 -DCOVERAGE=1 --coverage" CACHE STRING
   204    "Flags used by the C compiler during \"Coverage\" builds."
   205    FORCE
   206  )
   207  set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} --coverage" CACHE STRING
   208    "Flags used for linking binaries during \"Coverage\" builds."
   209    FORCE
   210  )
   211  set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} --coverage" CACHE STRING
   212    "Flags used by the shared libraries linker during \"Coverage\" builds."
   213    FORCE
   214  )
   215  mark_as_advanced(
   216    CMAKE_C_FLAGS_COVERAGE
   217    CMAKE_EXE_LINKER_FLAGS_COVERAGE
   218    CMAKE_SHARED_LINKER_FLAGS_COVERAGE
   219  )
   220  
   221  if(PROJECT_IS_TOP_LEVEL)
   222    get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
   223    set(default_build_type "RelWithDebInfo")
   224    if(is_multi_config)
   225      set(CMAKE_CONFIGURATION_TYPES "${default_build_type}" "Release" "Debug" "MinSizeRel" "Coverage" CACHE STRING
   226        "Supported configuration types."
   227        FORCE
   228      )
   229    else()
   230      set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
   231        STRINGS "${default_build_type}" "Release" "Debug" "MinSizeRel" "Coverage"
   232      )
   233      if(NOT CMAKE_BUILD_TYPE)
   234        message(STATUS "Setting build type to \"${default_build_type}\" as none was specified")
   235        set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING
   236          "Choose the type of build."
   237          FORCE
   238        )
   239      endif()
   240    endif()
   241  endif()
   242  
   243  include(TryAppendCFlags)
   244  if(MSVC)
   245    # Keep the following commands ordered lexicographically.
   246    try_append_c_flags(/W3) # Production quality warning level.
   247    try_append_c_flags(/wd4146) # Disable warning C4146 "unary minus operator applied to unsigned type, result still unsigned".
   248    try_append_c_flags(/wd4244) # Disable warning C4244 "'conversion' conversion from 'type1' to 'type2', possible loss of data".
   249    try_append_c_flags(/wd4267) # Disable warning C4267 "'var' : conversion from 'size_t' to 'type', possible loss of data".
   250    # Eliminate deprecation warnings for the older, less secure functions.
   251    add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
   252  else()
   253    # Keep the following commands ordered lexicographically.
   254    try_append_c_flags(-pedantic)
   255    try_append_c_flags(-Wall) # GCC >= 2.95 and probably many other compilers.
   256    try_append_c_flags(-Wcast-align) # GCC >= 2.95.
   257    try_append_c_flags(-Wcast-align=strict) # GCC >= 8.0.
   258    try_append_c_flags(-Wconditional-uninitialized) # Clang >= 3.0 only.
   259    try_append_c_flags(-Wextra) # GCC >= 3.4, this is the newer name of -W, which we don't use because older GCCs will warn about unused functions.
   260    try_append_c_flags(-Wnested-externs)
   261    try_append_c_flags(-Wno-long-long) # GCC >= 3.0, -Wlong-long is implied by -pedantic.
   262    try_append_c_flags(-Wno-overlength-strings) # GCC >= 4.2, -Woverlength-strings is implied by -pedantic.
   263    try_append_c_flags(-Wno-unused-function) # GCC >= 3.0, -Wunused-function is implied by -Wall.
   264    try_append_c_flags(-Wreserved-identifier) # Clang >= 13.0 only.
   265    try_append_c_flags(-Wshadow)
   266    try_append_c_flags(-Wstrict-prototypes)
   267    try_append_c_flags(-Wundef)
   268  endif()
   269  
   270  set(CMAKE_C_VISIBILITY_PRESET hidden)
   271  
   272  set(print_msan_notice)
   273  if(SECP256K1_BUILD_CTIME_TESTS)
   274    include(CheckMemorySanitizer)
   275    check_memory_sanitizer(msan_enabled)
   276    if(msan_enabled)
   277      try_append_c_flags(-fno-sanitize-memory-param-retval)
   278      set(print_msan_notice YES)
   279    endif()
   280    unset(msan_enabled)
   281  endif()
   282  
   283  set(SECP256K1_APPEND_CFLAGS "" CACHE STRING "Compiler flags that are appended to the command line after all other flags added by the build system. This variable is intended for debugging and special builds.")
   284  if(SECP256K1_APPEND_CFLAGS)
   285    # Appending to this low-level rule variable is the only way to
   286    # guarantee that the flags appear at the end of the command line.
   287    string(APPEND CMAKE_C_COMPILE_OBJECT " ${SECP256K1_APPEND_CFLAGS}")
   288  endif()
   289  
   290  set(SECP256K1_APPEND_LDFLAGS "" CACHE STRING "Linker flags that are appended to the command line after all other flags added by the build system. This variable is intended for debugging and special builds.")
   291  if(SECP256K1_APPEND_LDFLAGS)
   292    # Appending to this low-level rule variable is the only way to
   293    # guarantee that the flags appear at the end of the command line.
   294    string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " ${SECP256K1_APPEND_LDFLAGS}")
   295    string(APPEND CMAKE_C_LINK_EXECUTABLE " ${SECP256K1_APPEND_LDFLAGS}")
   296  endif()
   297  
   298  if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
   299    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
   300  endif()
   301  if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
   302    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
   303  endif()
   304  if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
   305    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
   306  endif()
   307  add_subdirectory(src)
   308  if(SECP256K1_BUILD_EXAMPLES)
   309    add_subdirectory(examples)
   310  endif()
   311  
   312  message("\n")
   313  message("secp256k1 configure summary")
   314  message("===========================")
   315  message("Build artifacts:")
   316  if(BUILD_SHARED_LIBS)
   317    set(library_type "Shared")
   318  else()
   319    set(library_type "Static")
   320  endif()
   321  
   322  message("  library type ........................ ${library_type}")
   323  message("Optional modules:")
   324  message("  ECDH ................................ ${SECP256K1_ENABLE_MODULE_ECDH}")
   325  message("  ECDSA pubkey recovery ............... ${SECP256K1_ENABLE_MODULE_RECOVERY}")
   326  message("  extrakeys ........................... ${SECP256K1_ENABLE_MODULE_EXTRAKEYS}")
   327  message("  schnorrsig .......................... ${SECP256K1_ENABLE_MODULE_SCHNORRSIG}")
   328  message("  musig ............................... ${SECP256K1_ENABLE_MODULE_MUSIG}")
   329  message("  ElligatorSwift ...................... ${SECP256K1_ENABLE_MODULE_ELLSWIFT}")
   330  message("Parameters:")
   331  message("  ecmult window size .................. ${SECP256K1_ECMULT_WINDOW_SIZE}")
   332  message("  ecmult gen table size ............... ${SECP256K1_ECMULT_GEN_KB} KiB")
   333  message("Optional features:")
   334  message("  assembly ............................ ${SECP256K1_ASM}")
   335  message("  external callbacks .................. ${SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS}")
   336  if(SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
   337    message("  wide multiplication (test-only) ..... ${SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY}")
   338  endif()
   339  message("Optional binaries:")
   340  message("  benchmark ........................... ${SECP256K1_BUILD_BENCHMARK}")
   341  message("  noverify_tests ...................... ${SECP256K1_BUILD_TESTS}")
   342  set(tests_status "${SECP256K1_BUILD_TESTS}")
   343  if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
   344    set(tests_status OFF)
   345  endif()
   346  message("  tests ............................... ${tests_status}")
   347  message("  exhaustive tests .................... ${SECP256K1_BUILD_EXHAUSTIVE_TESTS}")
   348  message("  ctime_tests ......................... ${SECP256K1_BUILD_CTIME_TESTS}")
   349  message("  examples ............................ ${SECP256K1_BUILD_EXAMPLES}")
   350  message("")
   351  if(CMAKE_CROSSCOMPILING)
   352    set(cross_status "TRUE, for ${CMAKE_SYSTEM_NAME}, ${CMAKE_SYSTEM_PROCESSOR}")
   353  else()
   354    set(cross_status "FALSE")
   355  endif()
   356  message("Cross compiling ....................... ${cross_status}")
   357  message("Valgrind .............................. ${SECP256K1_VALGRIND}")
   358  get_directory_property(definitions COMPILE_DEFINITIONS)
   359  string(REPLACE ";" " " definitions "${definitions}")
   360  message("Preprocessor defined macros ........... ${definitions}")
   361  message("C compiler ............................ ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}, ${CMAKE_C_COMPILER}")
   362  message("CFLAGS ................................ ${CMAKE_C_FLAGS}")
   363  get_directory_property(compile_options COMPILE_OPTIONS)
   364  string(REPLACE ";" " " compile_options "${compile_options}")
   365  message("Compile options ....................... " ${compile_options})
   366  if(NOT is_multi_config)
   367    message("Build type:")
   368    message(" - CMAKE_BUILD_TYPE ................... ${CMAKE_BUILD_TYPE}")
   369    string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type)
   370    message(" - CFLAGS ............................. ${CMAKE_C_FLAGS_${build_type}}")
   371    message(" - LDFLAGS for executables ............ ${CMAKE_EXE_LINKER_FLAGS_${build_type}}")
   372    message(" - LDFLAGS for shared libraries ....... ${CMAKE_SHARED_LINKER_FLAGS_${build_type}}")
   373  else()
   374    message("Supported configurations .............. ${CMAKE_CONFIGURATION_TYPES}")
   375    message("RelWithDebInfo configuration:")
   376    message(" - CFLAGS ............................. ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
   377    message(" - LDFLAGS for executables ............ ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
   378    message(" - LDFLAGS for shared libraries ....... ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}")
   379    message("Debug configuration:")
   380    message(" - CFLAGS ............................. ${CMAKE_C_FLAGS_DEBUG}")
   381    message(" - LDFLAGS for executables ............ ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
   382    message(" - LDFLAGS for shared libraries ....... ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
   383  endif()
   384  if(SECP256K1_APPEND_CFLAGS)
   385    message("SECP256K1_APPEND_CFLAGS ............... ${SECP256K1_APPEND_CFLAGS}")
   386  endif()
   387  if(SECP256K1_APPEND_LDFLAGS)
   388    message("SECP256K1_APPEND_LDFLAGS .............. ${SECP256K1_APPEND_LDFLAGS}")
   389  endif()
   390  message("")
   391  if(print_msan_notice)
   392    message(
   393      "Note:\n"
   394      "  MemorySanitizer detected, tried to add -fno-sanitize-memory-param-retval to compile options\n"
   395      "  to avoid false positives in ctime_tests. Pass -DSECP256K1_BUILD_CTIME_TESTS=OFF to avoid this.\n"
   396    )
   397  endif()
   398  if(SECP256K1_EXPERIMENTAL)
   399    message(
   400      "  ******\n"
   401      "  WARNING: experimental build\n"
   402      "  Experimental features do not have stable APIs or properties, and may not be safe for production use.\n"
   403      "  ******\n"
   404    )
   405  endif()