xmake.lua 997 B

12345678910111213141516171819202122232425
  1. package("noise-c")
  2. set_homepage("https://github.com/rweather/noise-c")
  3. set_description("Noise-C, a plain C implementation of the Noise protocol")
  4. set_license("MIT")
  5. add_urls("https://github.com/rweather/noise-c.git")
  6. add_versions("2021.04.09", "9379e580a14c0374a57d826a49ba53b7440c80bc")
  7. add_deps("autoconf", "automake", "bison", "flex")
  8. on_install("linux", "macosx", function (package)
  9. local configs = {}
  10. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  11. if package:debug() then
  12. table.insert(configs, "--enable-debug")
  13. end
  14. if package:is_plat("linux") and package:config("pic") ~= false then
  15. table.insert(configs, "--with-pic")
  16. end
  17. import("package.tools.autoconf").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:has_cfuncs("noise_handshakestate_set_prologue", {includes = "noise/protocol.h"}))
  21. end)