xmake.lua 1.1 KB

123456789101112131415161718192021222324252627
  1. package("ceval")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/erstan/ceval")
  4. set_description("A C/C++ library for parsing and evaluation of arithmetic expressions.")
  5. set_license("MIT")
  6. add_urls("https://github.com/erstan/ceval/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/erstan/ceval.git")
  8. add_versions("1.0.1", "fb5508fc40715d1f1a50a1fa737f3c88cb7aeb187fb2aede7c35f0758f277779")
  9. add_versions("1.0.0", "3bb8cca8f0f7bf6f5ee6e7198d1174eab4d493318b6d97cc739343017090573e")
  10. on_install(function (package)
  11. io.replace("core/parser.h", "malloc.h", "stdlib.h", {plain = true})
  12. os.mkdir(path.join(package:installdir("include"), "ceval"))
  13. os.cp("ceval.h", path.join(package:installdir("include"), "ceval", "ceval.h"))
  14. os.cp("core", path.join(package:installdir("include"), "ceval"))
  15. end)
  16. on_test(function (package)
  17. assert(package:check_csnippets({test = [[
  18. void test() {
  19. ceval_tree("1+1");
  20. ceval_result("1+1");
  21. }
  22. ]]}, {includes = "ceval/ceval.h"}))
  23. end)