diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index eceafc19c..5010e68f3 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -35,8 +35,13 @@ # ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with # others. +if(NOT MSVC) + add_compile_options(-D_GNU_SOURCE) +endif() + message(STATUS "Using in-tree miniupnpc") set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) +set(UPNPC_BUILD_TESTS FALSE CACHE BOOL "Disable miniupnp internal tests." FORCE) add_subdirectory(miniupnp/miniupnpc) set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/external/miniupnp b/external/miniupnp index 544e6fcc7..b55145ec0 160000 --- a/external/miniupnp +++ b/external/miniupnp @@ -1 +1 @@ -Subproject commit 544e6fcc73c5ad9af48a8985c94f0f1d742ef2e0 +Subproject commit b55145ec095652289a59c33603f3abafee898273 diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 505ba026e..50d2063ea 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -58,9 +58,9 @@ #include "cryptonote_core/cryptonote_core.h" #include "net/parse.h" -#include -#include -#include +#include +#include +#include #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" @@ -2985,7 +2985,8 @@ namespace nodetool UPNPUrls urls; IGDdatas igdData; char lanAddress[64]; - result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); + char wanaddr[64]; /* up address of the IGD on the WAN */ + result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanaddr, sizeof wanaddr); freeUPNPDevlist(deviceList); if (result > 0) { if (result == 1) { @@ -3053,7 +3054,8 @@ namespace nodetool UPNPUrls urls; IGDdatas igdData; char lanAddress[64]; - result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); + char wanaddr[64]; /* up address of the IGD on the WAN */ + result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanaddr, sizeof wanaddr); freeUPNPDevlist(deviceList); if (result > 0) { if (result == 1) { diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index fe80d3083..beb27b46d 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -96,12 +96,31 @@ monero_private_headers(daemon_rpc_server monero_add_library(rpc_base ${rpc_base_sources} ${rpc_base_headers} - ${rpc_base_private_headers}) + ${rpc_base_private_headers} + LINKS + common + epee + ${Boost_REGEX_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + PRIVATE_LINKS + ${EXTRA_LIBRARIES}) monero_add_library(rpc ${rpc_sources} ${rpc_headers} - ${rpc_private_headers}) + ${rpc_private_headers} + LINKS + rpc_base + common + cryptonote_core + cryptonote_protocol + net + version + ${Boost_REGEX_LIBRARY} + ${Boost_THREAD_LIBRARY} + PRIVATE_LINKS + ${EXTRA_LIBRARIES}) monero_add_library(rpc_pub ${rpc_pub_sources} @@ -118,30 +137,6 @@ monero_add_library(daemon_rpc_server ${daemon_rpc_server_headers} ${daemon_rpc_server_private_headers}) - -target_link_libraries(rpc_base - PUBLIC - common - epee - ${Boost_REGEX_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) - -target_link_libraries(rpc - PUBLIC - rpc_base - common - cryptonote_core - cryptonote_protocol - net - version - ${Boost_REGEX_LIBRARY} - ${Boost_THREAD_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) - target_link_libraries(rpc_pub PUBLIC epee