Use system headers when building with system miniupnpc

Fixes https://github.com/hrydgard/ppsspp/pull/15185
This commit is contained in:
李通洲 2021-12-06 00:21:14 +08:00
parent 3e5511b609
commit 17171bc9dc
2 changed files with 8 additions and 3 deletions

View File

@ -2050,6 +2050,7 @@ if(USE_MINIUPNPC)
find_package(MINIUPNPC REQUIRED)
target_include_directories(${CoreLibName} PRIVATE ${MINIUPNP_INCLUDE_DIR})
target_link_libraries(${CoreLibName} ${MINIUPNP_LIBRARY})
add_definitions(-DWITH_UPNP -DUSE_SYSTEM_MINIUPNPC)
else()
set (MINIUPNPC_VERSION 2.1) # used by miniupnpcstrings.h.cmake
set (MINIUPNPC_API_VERSION 17)

View File

@ -21,14 +21,18 @@
#pragma once
#ifdef USE_SYSTEM_MINIUPNPC
#include <miniupnpc/miniwget.h>
#include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h>
#else
#ifndef MINIUPNP_STATICLIB
#define MINIUPNP_STATICLIB
#endif
#include "ext/miniupnp/miniupnpc/miniwget.h"
#include "ext/miniupnp/miniupnpc/miniupnpc.h"
#include "ext/miniupnp/miniupnpc/upnpcommands.h"
#endif
#include <string>
#include <deque>