mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
Merge pull request #5937 from ligfx/miniupnpccmake
CMake: use miniupnpc target instead of global vars
This commit is contained in:
commit
08004d409e
@ -17,3 +17,11 @@ find_package_handle_standard_args(MINIUPNPC DEFAULT_MSG MINIUPNPC_INCLUDE_DIR MI
|
|||||||
set(MINIUPNPC_LIBRARIES ${MINIUPNPC_LIBRARY})
|
set(MINIUPNPC_LIBRARIES ${MINIUPNPC_LIBRARY})
|
||||||
set(MINIUPNPC_INCLUDE_DIRS ${MINIUPNPC_INCLUDE_DIR})
|
set(MINIUPNPC_INCLUDE_DIRS ${MINIUPNPC_INCLUDE_DIR})
|
||||||
mark_as_advanced(MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY MINIUPNPC_API_VERSION_STR)
|
mark_as_advanced(MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY MINIUPNPC_API_VERSION_STR)
|
||||||
|
|
||||||
|
if (MINIUPNPC_FOUND AND NOT TARGET miniupnpc)
|
||||||
|
add_library(Miniupnpc::miniupnpc UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(Miniupnpc::miniupnpc PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${MINIUPNPC_LIBRARIES}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${MINIUPNPC_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
@ -670,12 +670,8 @@ if(USE_UPNP)
|
|||||||
else()
|
else()
|
||||||
message(STATUS "Using static miniupnpc from Externals")
|
message(STATUS "Using static miniupnpc from Externals")
|
||||||
add_subdirectory(Externals/miniupnpc)
|
add_subdirectory(Externals/miniupnpc)
|
||||||
set(MINIUPNPC_INCLUDE_DIRS Externals/miniupnpc/src)
|
|
||||||
set(MINIUPNPC_LIBRARIES miniupnpc)
|
|
||||||
endif()
|
endif()
|
||||||
add_definitions(-DUSE_UPNP)
|
add_definitions(-DUSE_UPNP)
|
||||||
include_directories(${MINIUPNPC_INCLUDE_DIRS})
|
|
||||||
list(APPEND LIBS ${MINIUPNPC_LIBRARIES})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
|
4
Externals/miniupnpc/CMakeLists.txt
vendored
4
Externals/miniupnpc/CMakeLists.txt
vendored
@ -18,8 +18,6 @@ if(APPLE)
|
|||||||
add_definitions(-DMACOSX -D_DARWIN_C_SOURCE)
|
add_definitions(-DMACOSX -D_DARWIN_C_SOURCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(include)
|
|
||||||
|
|
||||||
set(SRCS src/igd_desc_parse.c
|
set(SRCS src/igd_desc_parse.c
|
||||||
src/miniupnpc.c
|
src/miniupnpc.c
|
||||||
src/minixml.c
|
src/minixml.c
|
||||||
@ -35,4 +33,6 @@ set(SRCS src/igd_desc_parse.c
|
|||||||
src/receivedata.c)
|
src/receivedata.c)
|
||||||
|
|
||||||
add_library(miniupnpc STATIC ${SRCS})
|
add_library(miniupnpc STATIC ${SRCS})
|
||||||
|
target_include_directories(miniupnpc PUBLIC src)
|
||||||
|
|
||||||
|
add_library(Miniupnpc::miniupnpc ALIAS miniupnpc)
|
||||||
|
@ -120,6 +120,10 @@ endif()
|
|||||||
|
|
||||||
add_dolphin_library(common "${SRCS}" "${LIBS}")
|
add_dolphin_library(common "${SRCS}" "${LIBS}")
|
||||||
|
|
||||||
|
if(USE_UPNP)
|
||||||
|
target_link_libraries(common PRIVATE Miniupnpc::miniupnpc)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(OPROFILE_FOUND)
|
if(OPROFILE_FOUND)
|
||||||
target_link_libraries(common PRIVATE ${OPROFILE_LIBRARIES})
|
target_link_libraries(common PRIVATE ${OPROFILE_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user