Skip to content

Commit

Permalink
refactor: jwt-cpp uses in-project json dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
huerni committed Nov 14, 2024
1 parent c987b4b commit 2ae9fd8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
1 change: 0 additions & 1 deletion dependencies/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ endif ()


add_subdirectory(BSThreadPool)
# add_subdirectory(nlohmann_json)
add_subdirectory(jwt-cpp)
add_subdirectory(yaml-cpp)
add_subdirectory(fmt)
Expand Down
19 changes: 19 additions & 0 deletions dependencies/cmake/jwt-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
include(FetchContent)

if (CRANE_USE_GITEE_SOURCE)
set(JSON_SRC_URL "https://gitee.com/zenglingbo/crane-sched-deps/raw/master/json-3.11.2.tar.gz")
else ()
set(JSON_SRC_URL "https://github.com/nlohmann/json/archive/refs/tags/v3.11.2.tar.gz")
endif ()

set(JWT_CPP_SRC_URL "https://github.com/Thalhammer/jwt-cpp/archive/refs/tags/v0.7.0.tar.gz")

FetchContent_Declare(json
URL ${JSON_SRC_URL}
URL_HASH SHA256=d69f9deb6a75e2580465c6c4c5111b89c4dc2fa94e3a85fcd2ffcd9a143d9273
INACTIVITY_TIMEOUT 5
)

FetchContent_GetProperties(json)
if (NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif ()

set(nlohmann_json_DIR "${json_BINARY_DIR}")

fetchcontent_declare(jwt-cpp
URL ${JWT_CPP_SRC_URL}
URL_HASH SHA256=b9eb270e3ba8221e4b2bc38723c9a1cb4fa6c241a42908b9a334daff31137406
Expand Down
19 changes: 0 additions & 19 deletions dependencies/cmake/nlohmann_json/CMakeLists.txt

This file was deleted.

0 comments on commit 2ae9fd8

Please sign in to comment.