fix(api): return proper json objects (#3544)

This commit is contained in:
ReenigneArcher
2025-01-31 23:38:22 -05:00
committed by GitHub
parent 5b36357133
commit 257a102127
19 changed files with 364 additions and 350 deletions

View File

@ -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}

View File

@ -76,7 +76,6 @@ list(PREPEND PLATFORM_LIBRARIES
libstdc++.a
libwinpthread.a
minhook::minhook
nlohmann_json::nlohmann_json
ntdll
setupapi
shlwapi

View File

@ -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)

View 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()

View File

@ -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)