diff --git a/CMakeLists.txt b/CMakeLists.txt index 96a495f935bcc..5d957221137fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -357,7 +357,6 @@ include(cmake/introspection.cmake) include(cmake/crc32c.cmake) include(cmake/leveldb.cmake) include(cmake/minisketch.cmake) -include(cmake/secp256k1.cmake) include(ProcessConfigurations) are_flags_overridden(CMAKE_CXX_FLAGS cxx_flags_overridden) @@ -633,8 +632,6 @@ else() endif() message("Cross compiling ....................... ${cross_status}") message("Preprocessor defined macros ........... ${definitions}") -message("C compiler ............................ ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}, ${CMAKE_C_COMPILER}") -message("CFLAGS ................................ ${CMAKE_C_FLAGS}") message("C++ compiler .......................... ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}, ${CMAKE_CXX_COMPILER}") message("CXXFLAGS .............................. ${CMAKE_CXX_FLAGS}") get_target_interface(common_compile_options core_interface COMPILE_OPTIONS) diff --git a/cmake/module/ProcessConfigurations.cmake b/cmake/module/ProcessConfigurations.cmake index d460e65fa3783..7d6064e0c9b67 100644 --- a/cmake/module/ProcessConfigurations.cmake +++ b/cmake/module/ProcessConfigurations.cmake @@ -144,7 +144,6 @@ function(print_config_flags) macro(print_flags config) string(TOUPPER "${config}" config_uppercase) message(" - Preprocessor defined macros ........ ${definitions_${config_uppercase}}") - message(" - CFLAGS ............................. ${CMAKE_C_FLAGS_${config_uppercase}}") message(" - CXXFLAGS ........................... ${CMAKE_CXX_FLAGS_${config_uppercase}}") message(" - LDFLAGS for executables ............ ${CMAKE_EXE_LINKER_FLAGS_${config_uppercase}}") message(" - LDFLAGS for shared libraries ....... ${CMAKE_SHARED_LINKER_FLAGS_${config_uppercase}}") diff --git a/cmake/secp256k1.cmake b/cmake/secp256k1.cmake deleted file mode 100644 index 822aa9911a8cf..0000000000000 --- a/cmake/secp256k1.cmake +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2023-present The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or https://opensource.org/license/mit/. - -# This file is part of the transition from Autotools to CMake. Once CMake -# support has been merged we should switch to using the upstream CMake -# buildsystem. - -enable_language(C) -set(CMAKE_C_STANDARD 90) -set(CMAKE_C_EXTENSIONS OFF) - -include(CheckCSourceCompiles) -check_c_source_compiles(" - #include - - int main() - { - uint64_t a = 11, tmp; - __asm__ __volatile__(\"movq $0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\"); - } - " HAVE_64BIT_ASM -) - -add_library(secp256k1 STATIC EXCLUDE_FROM_ALL - ${PROJECT_SOURCE_DIR}/src/secp256k1/src/secp256k1.c - ${PROJECT_SOURCE_DIR}/src/secp256k1/src/precomputed_ecmult.c - ${PROJECT_SOURCE_DIR}/src/secp256k1/src/precomputed_ecmult_gen.c -) - -target_compile_definitions(secp256k1 - PRIVATE - ECMULT_GEN_PREC_BITS=4 - ECMULT_WINDOW_SIZE=15 - ENABLE_MODULE_RECOVERY - ENABLE_MODULE_SCHNORRSIG - ENABLE_MODULE_EXTRAKEYS - ENABLE_MODULE_ELLSWIFT - $<$:USE_ASM_X86_64=1> - INTERFACE - $<$:SECP256K1_STATIC> -) - -target_include_directories(secp256k1 - PUBLIC - $ -) - -if(MSVC) - target_compile_options(secp256k1 - PRIVATE - /wd4146 - /wd4244 - /wd4267 - ) -endif() - -target_link_libraries(secp256k1 PRIVATE core_base_interface) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0646f419affb7..477e5adbbfd4a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,10 +1,20 @@ -# Copyright (c) 2023 The Bitcoin Core developers +# Copyright (c) 2024-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# file COPYING or https://opensource.org/license/mit/. include(GNUInstallDirs) include(AddWindowsResources) +option(SECP256K1_DISABLE_SHARED "" ON) +option(SECP256K1_ENABLE_MODULE_ECDH "" OFF) +option(SECP256K1_ENABLE_MODULE_RECOVERY "" ON) +option(SECP256K1_BUILD_BENCHMARK "" OFF) +option(SECP256K1_BUILD_TESTS "" OFF) +option(SECP256K1_BUILD_EXHAUSTIVE_TESTS "" OFF) +option(SECP256K1_BUILD_CTIME_TESTS "" OFF) +add_subdirectory(secp256k1) +target_link_libraries(secp256k1 PRIVATE core_base_interface) + configure_file(${CMAKE_SOURCE_DIR}/cmake/bitcoin-config.h.in config/bitcoin-config.h @ONLY) add_compile_definitions(HAVE_CONFIG_H) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})