Added miniupnp submodule

This commit is contained in:
SChernykh 2023-03-19 19:13:29 +01:00
parent c2d8c806d2
commit a84a0bd8dc
4 changed files with 17 additions and 1 deletions

3
.gitmodules vendored
View file

@ -22,3 +22,6 @@
[submodule "external/src/curl"] [submodule "external/src/curl"]
path = external/src/curl path = external/src/curl
url = https://github.com/SChernykh/curl url = https://github.com/SChernykh/curl
[submodule "external/src/miniupnp"]
path = external/src/miniupnp
url = https://github.com/SChernykh/miniupnp

View file

@ -5,6 +5,7 @@ option(STATIC_BINARY "Build static binary" OFF)
option(STATIC_LIBS "Link libuv and libzmq statically" OFF) option(STATIC_LIBS "Link libuv and libzmq statically" OFF)
option(WITH_RANDOMX "Include the RandomX library in the build. If this is turned off, p2pool will rely on monerod for verifying RandomX hashes" ON) option(WITH_RANDOMX "Include the RandomX library in the build. If this is turned off, p2pool will rely on monerod for verifying RandomX hashes" ON)
option(WITH_LTO "Use link-time compiler optimization (if linking fails for you, run cmake with -DWITH_LTO=OFF)" ON) option(WITH_LTO "Use link-time compiler optimization (if linking fails for you, run cmake with -DWITH_LTO=OFF)" ON)
option(WITH_UPNP "Include UPnP support. If this is turned off, p2pool will not be able to configure port forwarding on UPnP-enabled routers." ON)
option(DEV_TEST_SYNC "[Developer only] Sync test, stop p2pool after sync is complete" OFF) option(DEV_TEST_SYNC "[Developer only] Sync test, stop p2pool after sync is complete" OFF)
@ -17,7 +18,13 @@ endif()
if (WITH_RANDOMX) if (WITH_RANDOMX)
add_definitions(-DWITH_RANDOMX) add_definitions(-DWITH_RANDOMX)
add_subdirectory(external/src/RandomX) add_subdirectory(external/src/RandomX)
set(LIBS randomx) set(LIBS ${LIBS} randomx)
endif()
if (WITH_UPNP)
add_definitions(-DWITH_UPNP)
add_subdirectory(external/src/miniupnp/miniupnpc)
set(LIBS ${LIBS} libminiupnpc-static)
endif() endif()
if (DEV_TEST_SYNC) if (DEV_TEST_SYNC)
@ -117,6 +124,9 @@ if (WITH_RANDOMX)
endif() endif()
include_directories(external/src/rapidjson/include) include_directories(external/src/rapidjson/include)
include_directories(external/src/robin-hood-hashing/src/include) include_directories(external/src/robin-hood-hashing/src/include)
if (WITH_UPNP)
include_directories(external/src/miniupnp/miniupnpc/include)
endif()
if (WIN32) if (WIN32)
set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi) set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi)

1
external/src/miniupnp vendored Submodule

@ -0,0 +1 @@
Subproject commit b61674aa510a86ece3b5b41ec9d932f5b2bac5ad

View file

@ -84,6 +84,7 @@ TEST(pool_block, deserialize)
ASSERT_EQ(b.m_broadcasted, false); ASSERT_EQ(b.m_broadcasted, false);
ASSERT_EQ(b.m_wantBroadcast, false); ASSERT_EQ(b.m_wantBroadcast, false);
#if !(defined(__FreeBSD__) || defined(__OpenBSD__))
RandomX_Hasher hasher(nullptr); RandomX_Hasher hasher(nullptr);
hash seed; hash seed;
@ -103,6 +104,7 @@ TEST(pool_block, deserialize)
ASSERT_EQ(s.str(), "aa7a3c4a2d67cb6a728e244288219bf038024f3b511b0da197a19ec601000000"); ASSERT_EQ(s.str(), "aa7a3c4a2d67cb6a728e244288219bf038024f3b511b0da197a19ec601000000");
ASSERT_EQ(b.m_difficulty.check_pow(pow_hash), true); ASSERT_EQ(b.m_difficulty.check_pow(pow_hash), true);
#endif
destroy_crypto_cache(); destroy_crypto_cache();
} }