mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-02-04 06:25:27 +00:00
fix(api): return proper json objects (#3544)
This commit is contained in:
@ -149,6 +149,7 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
enet
|
||||
libdisplaydevice::display_device
|
||||
nlohmann_json::nlohmann_json
|
||||
opus
|
||||
${FFMPEG_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
|
||||
@ -76,7 +76,6 @@ list(PREPEND PLATFORM_LIBRARIES
|
||||
libstdc++.a
|
||||
libwinpthread.a
|
||||
minhook::minhook
|
||||
nlohmann_json::nlohmann_json
|
||||
ntdll
|
||||
setupapi
|
||||
shlwapi
|
||||
|
||||
@ -16,6 +16,7 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/Simple-Web-Server")
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/libdisplaydevice")
|
||||
|
||||
# common dependencies
|
||||
include("${CMAKE_MODULE_PATH}/dependencies/nlohmann_json.cmake")
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
18
cmake/dependencies/nlohmann_json.cmake
Normal file
18
cmake/dependencies/nlohmann_json.cmake
Normal file
@ -0,0 +1,18 @@
|
||||
#
|
||||
# Loads the nlohmann_json library giving the priority to the system package first, with a fallback to FetchContent.
|
||||
#
|
||||
include_guard(GLOBAL)
|
||||
|
||||
find_package(nlohmann_json 3.11 QUIET GLOBAL)
|
||||
if(NOT nlohmann_json_FOUND)
|
||||
message(STATUS "nlohmann_json v3.11.x package not found in the system. Falling back to FetchContent.")
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
json
|
||||
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
|
||||
URL_HASH MD5=c23a33f04786d85c29fda8d16b5f0efd
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP
|
||||
)
|
||||
FetchContent_MakeAvailable(json)
|
||||
endif()
|
||||
@ -1,8 +1,5 @@
|
||||
# windows specific dependencies
|
||||
|
||||
# nlohmann_json
|
||||
find_package(nlohmann_json CONFIG 3.11 REQUIRED)
|
||||
|
||||
# Make sure MinHook is installed
|
||||
find_library(MINHOOK_LIBRARY libMinHook.a REQUIRED)
|
||||
find_path(MINHOOK_INCLUDE_DIR MinHook.h PATH_SUFFIXES include REQUIRED)
|
||||
|
||||
Reference in New Issue
Block a user