xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("metalang99")
  2. set_kind("library", { headeronly = true })
  3. set_homepage("https://github.com/Hirrolot/metalang99")
  4. set_description("Full-blown preprocessor metaprogramming")
  5. set_license("MIT")
  6. add_urls("https://github.com/Hirrolot/metalang99/archive/refs/tags/v$(version).tar.gz",
  7. "https://github.com/Hirrolot/metalang99.git")
  8. add_versions("1.13.2", "912c6d91b872d34d2b6580d25afc38faccacf6c57462ab1c862010ff4afbf790")
  9. add_versions("1.13.3", "91fe8d4edcc2e7f91c5b567a2b90f2e30c2373f1ebbabcf209ea0d74f63bc1e9")
  10. on_install(function(package)
  11. os.cp("include", package:installdir())
  12. end)
  13. on_test(function(package)
  14. assert(package:check_csnippets({test = [[
  15. typedef struct {
  16. double width, height;
  17. } Rect;
  18. #define Rect_new(...) ML99_OVERLOAD(Rect_new_, __VA_ARGS__)
  19. #define Rect_new_1(x) { x, x }
  20. #define Rect_new_2(x, y) { x, y }
  21. static Rect ra = Rect_new(7, 8);
  22. static Rect rb = Rect_new(10);
  23. ]]}, { configs = { languages = "c11" }, includes = "metalang99.h" }))
  24. end)