xmake.lua 1.4 KB

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