Optionally allow the system installation of MiniUPnP to be used (#1959)
This commit is contained in:
@@ -118,7 +118,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||||
libminiupnpc-static
|
${MINIUPNP_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
enet
|
enet
|
||||||
opus
|
opus
|
||||||
|
|||||||
@@ -9,13 +9,33 @@ add_subdirectory(third-party/moonlight-common-c/enet)
|
|||||||
# web server
|
# web server
|
||||||
add_subdirectory(third-party/Simple-Web-Server)
|
add_subdirectory(third-party/Simple-Web-Server)
|
||||||
|
|
||||||
|
# common dependencies
|
||||||
|
find_package(OpenSSL REQUIRED)
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
pkg_check_modules(CURL REQUIRED libcurl)
|
||||||
|
|
||||||
# miniupnp
|
# miniupnp
|
||||||
set(UPNPC_BUILD_SHARED OFF CACHE BOOL "No shared libraries")
|
if(SUNSHINE_SYSTEM_MINIUPNP)
|
||||||
set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Don't build tests for miniupnpc")
|
pkg_check_modules(MINIUPNP miniupnpc REQUIRED)
|
||||||
set(UPNPC_BUILD_SAMPLE OFF CACHE BOOL "Don't build samples for miniupnpc")
|
|
||||||
set(UPNPC_NO_INSTALL ON CACHE BOOL "Don't install any libraries build for miniupnpc")
|
# Use includedir pkg-config variable rather than MINIUPNP_INCLUDE_DIRS
|
||||||
add_subdirectory(third-party/miniupnp/miniupnpc)
|
# defined above. The latter may be blank, as pkg-config sometimes omits -I
|
||||||
include_directories(SYSTEM third-party/miniupnp/miniupnpc/include)
|
# flags for directories that are searched by default (e.g. /usr/include),
|
||||||
|
# but we need a value to append /miniupnpc to. Normally source files would
|
||||||
|
# prefix their #include directives with miniupnpc/, but this does not align
|
||||||
|
# with the directory structure of the git submodule used below.
|
||||||
|
pkg_get_variable(MINIUPNP_INCLUDE_DIR miniupnpc includedir)
|
||||||
|
include_directories(SYSTEM ${MINIUPNP_INCLUDE_DIR}/miniupnpc)
|
||||||
|
else()
|
||||||
|
set(UPNPC_BUILD_SHARED OFF CACHE BOOL "No shared libraries")
|
||||||
|
set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Don't build tests for miniupnpc")
|
||||||
|
set(UPNPC_BUILD_SAMPLE OFF CACHE BOOL "Don't build samples for miniupnpc")
|
||||||
|
set(UPNPC_NO_INSTALL ON CACHE BOOL "Don't install any libraries build for miniupnpc")
|
||||||
|
set(MINIUPNP_LIBRARIES libminiupnpc-static)
|
||||||
|
add_subdirectory(third-party/miniupnp/miniupnpc)
|
||||||
|
include_directories(SYSTEM third-party/miniupnp/miniupnpc/include)
|
||||||
|
endif()
|
||||||
|
|
||||||
# ffmpeg pre-compiled binaries
|
# ffmpeg pre-compiled binaries
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@@ -66,12 +86,6 @@ set(FFMPEG_LIBRARIES
|
|||||||
${HDR10_PLUS_LIBRARY}
|
${HDR10_PLUS_LIBRARY}
|
||||||
${FFMPEG_PLATFORM_LIBRARIES})
|
${FFMPEG_PLATFORM_LIBRARIES})
|
||||||
|
|
||||||
# common dependencies
|
|
||||||
find_package(OpenSSL REQUIRED)
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
pkg_check_modules(CURL REQUIRED libcurl)
|
|
||||||
|
|
||||||
# platform specific dependencies
|
# platform specific dependencies
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
include(${CMAKE_MODULE_PATH}/dependencies/windows.cmake)
|
include(${CMAKE_MODULE_PATH}/dependencies/windows.cmake)
|
||||||
@@ -84,4 +98,3 @@ elseif(UNIX)
|
|||||||
include(${CMAKE_MODULE_PATH}/dependencies/linux.cmake)
|
include(${CMAKE_MODULE_PATH}/dependencies/linux.cmake)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF)
|
|||||||
option(SUNSHINE_ENABLE_TRAY "Enable system tray icon. This option will be ignored on macOS." ON)
|
option(SUNSHINE_ENABLE_TRAY "Enable system tray icon. This option will be ignored on macOS." ON)
|
||||||
option(SUNSHINE_REQUIRE_TRAY "Require system tray icon. Fail the build if tray requirements are not met." ON)
|
option(SUNSHINE_REQUIRE_TRAY "Require system tray icon. Fail the build if tray requirements are not met." ON)
|
||||||
|
|
||||||
|
option(SUNSHINE_SYSTEM_MINIUPNP "Use system installation of MiniUPnP rather than the submodule." OFF)
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
option(SUNSHINE_CONFIGURE_PORTFILE
|
option(SUNSHINE_CONFIGURE_PORTFILE
|
||||||
"Configure macOS Portfile. Recommended to use with SUNSHINE_CONFIGURE_ONLY" OFF)
|
"Configure macOS Portfile. Recommended to use with SUNSHINE_CONFIGURE_ONLY" OFF)
|
||||||
|
|||||||
Reference in New Issue
Block a user