xmake.lua 1.0 KB

1234567891011121314151617181920212223242526
  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.0", "3bb8cca8f0f7bf6f5ee6e7198d1174eab4d493318b6d97cc739343017090573e")
  9. on_install(function (package)
  10. io.replace("core/parser.h", "malloc.h", "stdlib.h", {plain = true})
  11. os.mkdir(path.join(package:installdir("include"), "ceval"))
  12. os.cp("ceval.h", path.join(package:installdir("include"), "ceval", "ceval.h"))
  13. os.cp("core", path.join(package:installdir("include"), "ceval"))
  14. end)
  15. on_test(function (package)
  16. assert(package:check_csnippets({test = [[
  17. void test() {
  18. ceval_tree("1+1");
  19. ceval_result("1+1");
  20. }
  21. ]]}, {includes = "ceval/ceval.h"}))
  22. end)