cmake: only fallback to vendored miniupnpc

This commit is contained in:
selsta 2022-08-16 03:32:02 +02:00
parent b6a029f222
commit 7ce309b421
No known key found for this signature in database
GPG Key ID: 2EA0A99A8B07AE5E
3 changed files with 19 additions and 17 deletions

View File

@ -37,7 +37,7 @@ set(MINIUPNP_STATIC_LIBRARIES ${MINIUPNP_STATIC_LIBRARY})
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( find_package_handle_standard_args(
MiniUPnPc DEFAULT_MSG Miniupnpc DEFAULT_MSG
MINIUPNP_INCLUDE_DIR MINIUPNP_INCLUDE_DIR
MINIUPNP_LIBRARY MINIUPNP_LIBRARY
) )

View File

@ -35,8 +35,9 @@
# ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with # ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with
# others. # others.
find_package(Miniupnpc REQUIRED) find_package(Miniupnpc)
if(NOT MINIUPNP_FOUND)
message(STATUS "Using in-tree miniupnpc") message(STATUS "Using in-tree miniupnpc")
set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
add_subdirectory(miniupnp/miniupnpc) add_subdirectory(miniupnp/miniupnpc)
@ -51,7 +52,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
endif() endif()
set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) set(MINIUPNP_LIBRARY "libminiupnpc-static" PARENT_SCOPE)
endif()
find_package(Unbound) find_package(Unbound)

View File

@ -41,7 +41,7 @@ target_link_libraries(p2p
version version
cryptonote_core cryptonote_core
net net
${UPNP_LIBRARIES} ${MINIUPNP_LIBRARY}
${Boost_CHRONO_LIBRARY} ${Boost_CHRONO_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}