xmake.lua 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package("sha2")
  2. set_homepage("https://github.com/ogay/sha2")
  3. set_description("Fast software implementation in C of the FIPS 180-2 hash algorithms SHA-224, SHA-256, SHA-384 and SHA-512.")
  4. add_urls("https://github.com/ogay/sha2.git")
  5. add_versions("2024.05.23", "b90991f90967a46d0955dc981e9e3cd53c13b061")
  6. if is_plat("wasm") then
  7. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  8. end
  9. on_install(function (package)
  10. io.writefile("xmake.lua", [[
  11. add_rules("mode.debug", "mode.release")
  12. target("sha2")
  13. set_kind("$(kind)")
  14. if is_plat("windows") and is_kind("shared") then
  15. add_rules("utils.symbols.export_all")
  16. end
  17. add_files("sha2.c")
  18. add_headerfiles("sha2.h")
  19. ]])
  20. import("package.tools.xmake").install(package)
  21. end)
  22. on_test(function (package)
  23. assert(package:has_cfuncs("sha256_update", {includes = "sha2.h"}))
  24. end)