xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829
  1. package("squirrel")
  2. set_homepage("http://www.squirrel-lang.org")
  3. set_description("Official repository for the programming language Squirrel")
  4. set_license("MIT")
  5. add_urls("https://github.com/albertodemichelis/squirrel/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/albertodemichelis/squirrel.git")
  7. add_versions("v3.2", "02805414cfadd5bbb921891d3599b83375a40650abd6404a8ab407dc5e86a996")
  8. add_patches("3.2", "https://github.com/albertodemichelis/squirrel/commit/79711c69e2c4193b4b6f98c9162856d61ddaeb9f.patch", "908ef342bda194216d4d2c08f0ecdbd1518e368ef3b6ccdc15e3593c5b7725c2")
  9. add_deps("cmake")
  10. on_install("!wasm and !iphoneos", function (package)
  11. local configs = {}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. if package:config("shared") then
  15. table.join2(configs, {"-DDISABLE_STATIC=ON", "-DDISABLE_DYNAMIC=OFF"})
  16. else
  17. table.join2(configs, {"-DDISABLE_STATIC=OFF", "-DDISABLE_DYNAMIC=ON"})
  18. end
  19. import("package.tools.cmake").install(package, configs)
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cfuncs("sq_open", {includes = "squirrel.h"}))
  23. end)