xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("duktape")
  2. set_homepage("https://github.com/svaarala/duktape")
  3. set_description("Duktape - embeddable Javascript engine with a focus on portability and compact footprint")
  4. set_license("MIT")
  5. add_urls("https://github.com/svaarala/duktape/releases/download/v$(version)/duktape-$(version).tar.xz",
  6. "https://github.com/svaarala/duktape.git")
  7. add_versions("2.7.0", "90f8d2fa8b5567c6899830ddef2c03f3c27960b11aca222fa17aa7ac613c2890")
  8. on_install(function (package)
  9. local configs = {}
  10. io.writefile("xmake.lua", [[
  11. add_rules("mode.release", "mode.debug")
  12. target("duktape")
  13. set_kind("$(kind)")
  14. add_files("src-noline/*.c")
  15. add_headerfiles("src-noline/(*.h)")
  16. if is_plat("windows") and is_kind("shared") then
  17. add_rules("utils.symbols.export_all", {export_classes = true})
  18. end
  19. ]])
  20. import("package.tools.xmake").install(package)
  21. end)
  22. on_test(function (package)
  23. assert(package:has_cfuncs("duk_push_c_function", {includes = "duktape.h"}))
  24. end)