xmake.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. package("mujs")
  2. set_homepage("http://mujs.com/")
  3. set_description("An embeddable Javascript interpreter in C.")
  4. add_urls("https://mujs.com/downloads/mujs-$(version).tar.gz")
  5. add_urls("https://github.com/ccxvii/mujs/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/ccxvii/mujs.git")
  7. add_versions("1.3.4", "c015475880f6a382e706169c94371a7dd6cc22078832f6e0865af8289c2ef42b")
  8. if is_plat("linux", "bsd") then
  9. add_syslinks("m")
  10. end
  11. add_includedirs("include", "include/mujs")
  12. on_install(function (package)
  13. io.writefile("xmake.lua", [[
  14. add_rules("mode.release", "mode.debug")
  15. target("mujs")
  16. set_kind("$(kind)")
  17. add_files("js*.c", "utf*.c", "regexp.c")
  18. add_headerfiles("*.h", {prefixdir = "mujs"})
  19. if is_plat("windows") and is_kind("shared") then
  20. add_rules("utils.symbols.export_all")
  21. end
  22. ]])
  23. import("package.tools.xmake").install(package)
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("js_newstate", {includes = "mujs/mujs.h"}))
  27. end)