diff options
author | anonimal <anonimal@i2pmail.org> | 2018-04-21 09:30:55 +0000 |
---|---|---|
committer | anonimal <anonimal@i2pmail.org> | 2018-04-21 09:43:23 +0000 |
commit | 6b8539803184eebbf6bb7aef499ac0f5f242901d (patch) | |
tree | feabede3ade953aeb54d48f7588029ff28573915 /external | |
parent | CMake: update new location of in-tree miniupnpc (diff) | |
download | monero-6b8539803184eebbf6bb7aef499ac0f5f242901d.tar.xz |
Build: update CMake and p2p for in-tree miniupnp
(cherry picked from commit a7366b5feeffaeb65b217b2d6f138e0ab1c90192)
Diffstat (limited to 'external')
-rw-r--r-- | external/CMakeLists.txt | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index b4f712ee6..1fc4d64c1 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -34,43 +34,22 @@ # We always compile if we are building statically to reduce static dependency issues... # ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with # others. -if(NOT IOS) - find_package(Miniupnpc QUIET) -endif() -# If we have the correct shared version and we're not building static, use it -if(STATIC OR IOS) - set(USE_SHARED_MINIUPNPC false) -elseif(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER) - set(USE_SHARED_MINIUPNPC true) -endif() +find_package(Miniupnpc REQUIRED) -if(USE_SHARED_MINIUPNPC) - message(STATUS "Using shared miniupnpc found at ${MINIUPNP_INCLUDE_DIR}") +message(STATUS "Using in-tree miniupnpc") - set(UPNP_STATIC false PARENT_SCOPE) - set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE) - set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE) -else() - if(STATIC) - message(STATUS "Using miniupnpc from local source tree for static build") - else() - message(STATUS "Using miniupnpc from local source tree (/external/miniupnp/miniupnpc)") - endif() +add_subdirectory(miniupnp/miniupnpc) - add_subdirectory(miniupnp/miniupnpc) - - set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") - if(MSVC) - set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") - elseif(NOT MSVC) - set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") - endif() - - set(UPNP_STATIC true PARENT_SCOPE) - set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) +set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") +if(MSVC) + set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") +elseif(NOT MSVC) + set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") endif() +set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) + find_package(Unbound) if(NOT UNBOUND_INCLUDE_DIR OR STATIC) |