xmake.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package("aws-lc")
  2. set_homepage("https://github.com/aws/aws-lc")
  3. set_description("AWS-LC is a general-purpose cryptographic library maintained by the AWS Cryptography team for AWS and their customers. It іs based on code from the Google BoringSSL project and the OpenSSL project.")
  4. add_urls("https://github.com/aws/aws-lc/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/aws/aws-lc.git")
  6. add_versions("v1.31.0", "f2dfe0ef8fe21482b6795da01a1b226f826e9a084833ff8d5371a02f9623c150")
  7. add_configs("jitter", {description = "Enable FIPS entropy source: CPU Jitter", default = false, type = "boolean"})
  8. add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
  9. add_deps("cmake")
  10. if is_plat("windows") then
  11. add_deps("nasm")
  12. end
  13. add_links("ssl", "crypto")
  14. if is_plat("windows", "mingw") then
  15. add_syslinks("ws2_32")
  16. elseif is_plat("linux", "bsd") then
  17. add_syslinks("pthread", "dl", "m")
  18. end
  19. on_install(function (package)
  20. if package:config("shared") and package:is_plat("windows") then
  21. package:add("defines", "BORINGSSL_SHARED_LIBRARY")
  22. end
  23. local configs = {
  24. "-DBUILD_TESTING=OFF",
  25. "-DCMAKE_INSTALL_INCLUDEDIR=include",
  26. "-DBUILD_LIBSSL=ON",
  27. "-DDISABLE_GO=ON", "-DDISABLE_PERL=ON"
  28. }
  29. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  30. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  31. table.insert(configs, "-DBUILD_LIBSSL=ON")
  32. table.insert(configs, "-DENABLE_FIPS_ENTROPY_CPU_JITTER=" .. (package:config("jitter") and "ON" or "OFF"))
  33. table.insert(configs, "-DBUILD_TOOL=" .. (package:config("tools") and "ON" or "OFF"))
  34. import("package.tools.cmake").install(package, configs)
  35. end)
  36. on_test(function (package)
  37. assert(package:has_cfuncs("SSL_new", {includes = "openssl/ssl.h"}))
  38. end)