xmake.lua 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package("cpp-jwt")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/arun11299/cpp-jwt")
  4. set_description("JSON Web Token library for C++")
  5. set_license("MIT")
  6. add_urls("https://github.com/arun11299/cpp-jwt/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/arun11299/cpp-jwt.git")
  8. add_versions("v1.4", "1cb8039ee15bf9bf735c26082d7ff50c23d2886d65015dd6b0668c65e17dd20f")
  9. add_deps("nlohmann_json", "openssl3")
  10. on_install("!wasm@macosx and !iphoneos@macosx and !android",function (package)
  11. os.cp("include/jwt", package:installdir("include"))
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. #include <cassert>
  16. #include <jwt/jwt.hpp>
  17. void test() {
  18. using namespace jwt::params;
  19. jwt::jwt_object obj{algorithm("HS256"), secret("secret")};
  20. obj.add_claim("test", "12345");
  21. assert(obj.has_claim("test"));
  22. }
  23. ]]}, {configs = {languages = "cxx17"}}))
  24. end)