diff --git a/CMakeLists.txt b/CMakeLists.txt index e68af79b515..852839f30fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,11 +121,6 @@ option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting execu option(WERROR "Treat compiler warnings as errors." OFF) option(WITH_CCACHE "Attempt to use ccache for compiling." ON) -option(WITH_MINIUPNPC "Enable UPnP." OFF) -if(WITH_MINIUPNPC) - find_package(MiniUPnPc MODULE REQUIRED) -endif() - option(WITH_ZMQ "Enable ZMQ notifications." OFF) if(WITH_ZMQ) if(VCPKG_TARGET_TRIPLET) @@ -234,7 +229,6 @@ if(BUILD_FOR_FUZZING) set(BUILD_WALLET_TOOL OFF) set(BUILD_GUI OFF) set(ENABLE_EXTERNAL_SIGNER OFF) - set(WITH_MINIUPNPC OFF) set(WITH_ZMQ OFF) set(BUILD_TESTS OFF) set(BUILD_GUI_TESTS OFF) @@ -612,7 +606,6 @@ if(ENABLE_WALLET) message(" - legacy wallets (Berkeley DB) ..... ${WITH_BDB}") endif() message(" external signer ..................... ${ENABLE_EXTERNAL_SIGNER}") -message(" port mapping using UPnP ............. ${WITH_MINIUPNPC}") message(" ZeroMQ .............................. ${WITH_ZMQ}") message(" USDT tracing ........................ ${WITH_USDT}") message(" QR code (GUI) ....................... ${WITH_QRENCODE}") diff --git a/CMakePresets.json b/CMakePresets.json index 3bbb61afcec..c9d2d1b31fe 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -84,7 +84,6 @@ "ENABLE_WALLET": "ON", "WARN_INCOMPATIBLE_BDB": "OFF", "WITH_BDB": "ON", - "WITH_MINIUPNPC": "ON", "WITH_MULTIPROCESS": "ON", "WITH_QRENCODE": "ON", "WITH_SQLITE": "ON", diff --git a/cmake/module/FindMiniUPnPc.cmake b/cmake/module/FindMiniUPnPc.cmake deleted file mode 100644 index 34b94f05f16..00000000000 --- a/cmake/module/FindMiniUPnPc.cmake +++ /dev/null @@ -1,84 +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/. - -if(NOT MSVC) - find_package(PkgConfig REQUIRED) - pkg_check_modules(PC_MiniUPnPc QUIET miniupnpc) -endif() - -find_path(MiniUPnPc_INCLUDE_DIR - NAMES miniupnpc/miniupnpc.h - PATHS ${PC_MiniUPnPc_INCLUDE_DIRS} -) - -if(MiniUPnPc_INCLUDE_DIR) - file( - STRINGS "${MiniUPnPc_INCLUDE_DIR}/miniupnpc/miniupnpc.h" version_strings - REGEX "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+[0-9]+" - ) - string(REGEX REPLACE "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+([0-9]+)" "\\1" MiniUPnPc_API_VERSION "${version_strings}") - - # The minimum supported miniUPnPc API version is set to 17. This excludes - # versions with known vulnerabilities. - if(MiniUPnPc_API_VERSION GREATER_EQUAL 17) - set(MiniUPnPc_API_VERSION_OK TRUE) - endif() -endif() - -if(MSVC) - cmake_path(GET MiniUPnPc_INCLUDE_DIR PARENT_PATH MiniUPnPc_IMPORTED_PATH) - find_library(MiniUPnPc_LIBRARY_DEBUG - NAMES miniupnpc PATHS ${MiniUPnPc_IMPORTED_PATH}/debug/lib - NO_DEFAULT_PATH - ) - find_library(MiniUPnPc_LIBRARY_RELEASE - NAMES miniupnpc PATHS ${MiniUPnPc_IMPORTED_PATH}/lib - NO_DEFAULT_PATH - ) - set(MiniUPnPc_required MiniUPnPc_IMPORTED_PATH) -else() - find_library(MiniUPnPc_LIBRARY - NAMES miniupnpc - PATHS ${PC_MiniUPnPc_LIBRARY_DIRS} - ) - set(MiniUPnPc_required MiniUPnPc_LIBRARY) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MiniUPnPc - REQUIRED_VARS ${MiniUPnPc_required} MiniUPnPc_INCLUDE_DIR MiniUPnPc_API_VERSION_OK -) - -if(MiniUPnPc_FOUND AND NOT TARGET MiniUPnPc::MiniUPnPc) - add_library(MiniUPnPc::MiniUPnPc UNKNOWN IMPORTED) - set_target_properties(MiniUPnPc::MiniUPnPc PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${MiniUPnPc_INCLUDE_DIR}" - ) - if(MSVC) - if(MiniUPnPc_LIBRARY_DEBUG) - set_property(TARGET MiniUPnPc::MiniUPnPc APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(MiniUPnPc::MiniUPnPc PROPERTIES - IMPORTED_LOCATION_DEBUG "${MiniUPnPc_LIBRARY_DEBUG}" - ) - endif() - if(MiniUPnPc_LIBRARY_RELEASE) - set_property(TARGET MiniUPnPc::MiniUPnPc APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(MiniUPnPc::MiniUPnPc PROPERTIES - IMPORTED_LOCATION_RELEASE "${MiniUPnPc_LIBRARY_RELEASE}" - ) - endif() - else() - set_target_properties(MiniUPnPc::MiniUPnPc PROPERTIES - IMPORTED_LOCATION "${MiniUPnPc_LIBRARY}" - ) - endif() - set_property(TARGET MiniUPnPc::MiniUPnPc PROPERTY - INTERFACE_COMPILE_DEFINITIONS USE_UPNP=1 $<$:MINIUPNP_STATICLIB> - ) -endif() - -mark_as_advanced( - MiniUPnPc_INCLUDE_DIR - MiniUPnPc_LIBRARY -) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a86465bbaf..30a1a562dd0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -294,7 +294,6 @@ target_link_libraries(bitcoin_node Boost::headers $ $ - $ $ $ ) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 7ec2b74cc8f..71592124f22 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -133,7 +133,6 @@ target_link_libraries(bitcoinqt bitcoin_cli leveldb Boost::headers - $ $ $<$:-framework\ AppKit> $<$:shlwapi> diff --git a/vcpkg.json b/vcpkg.json index ecbccb072c2..6343ca4eb35 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -13,7 +13,6 @@ ], "default-features": [ "wallet", - "miniupnpc", "zeromq", "tests", "qt5" @@ -31,10 +30,6 @@ "description": "Enable Berkeley DB wallet support", "dependencies": [ "berkeleydb" ] }, - "miniupnpc": { - "description": "Enable UPnP", - "dependencies": [ "miniupnpc" ] - }, "zeromq": { "description": "Enable ZMQ notifications", "dependencies": [ "zeromq" ]