cpp-jwt: add package (#3858)
* cpp-jwt: add package * cpp-jwt: exclude platforms * cpp-jwt: update limits * cpp-jwt: use limitspull/3865/head
parent
f68a648a9c
commit
c61ce10e6d
1 changed files with 29 additions and 0 deletions
@ -0,0 +1,29 @@ |
||||
package("cpp-jwt") |
||||
set_kind("library", {headeronly = true}) |
||||
set_homepage("https://github.com/arun11299/cpp-jwt") |
||||
set_description("JSON Web Token library for C++") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/arun11299/cpp-jwt/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/arun11299/cpp-jwt.git") |
||||
|
||||
add_versions("v1.4", "1cb8039ee15bf9bf735c26082d7ff50c23d2886d65015dd6b0668c65e17dd20f") |
||||
|
||||
add_deps("nlohmann_json", "openssl3") |
||||
|
||||
on_install("!wasm@macosx and !iphoneos@macosx and !android",function (package) |
||||
os.cp("include/jwt", package:installdir("include")) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
#include <cassert> |
||||
#include <jwt/jwt.hpp> |
||||
void test() { |
||||
using namespace jwt::params; |
||||
jwt::jwt_object obj{algorithm("HS256"), secret("secret")}; |
||||
obj.add_claim("test", "12345"); |
||||
assert(obj.has_claim("test")); |
||||
} |
||||
]]}, {configs = {languages = "cxx17"}})) |
||||
end) |
Loading…
Reference in new issue