xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728
  1. package("wolfssl")
  2. set_homepage("https://www.wolfssl.com")
  3. set_description("The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3!")
  4. set_license("GPL-2.0")
  5. add_urls("https://github.com/wolfSSL/wolfssl/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/wolfSSL/wolfssl.git")
  7. add_versions("v5.3.0-stable", "1a3bb310dc01d3e73d9ad91b6ea8249d081016f8eef4ae8f21d3421f91ef1de9")
  8. add_configs("openssl_extra", {description = "WOLFSSL_OPENSSLEXTRA", default = false, type = "boolean"})
  9. add_deps("cmake")
  10. on_install(function (package)
  11. local configs = {}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. table.insert(configs, "-DWOLFSSL_OPENSSLEXTRA=" .. (package:config("openssl_extra") and "yes" or "no"))
  15. local ldflags
  16. if package:is_plat("android") then
  17. ldflags = "-llog"
  18. end
  19. import("package.tools.cmake").install(package, configs, {ldflags = ldflags})
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cincludes("wolfssl/ssl.h"))
  23. end)