xmake.lua 1.0 KB

12345678910111213141516171819202122232425262728
  1. package("dbg-macro")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/sharkdp/dbg-macro")
  4. set_description("A dbg(…) macro for C++")
  5. set_license("MIT")
  6. add_urls("https://github.com/sharkdp/dbg-macro/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/sharkdp/dbg-macro.git")
  8. add_versions("v0.5.1", "fffea75f067c69995853dc790626887788e2c4c9eb0a5a0014a4501d2b6b9909")
  9. add_versions("v0.4.0", "e44a1206fbfd1d3dc8ad649f387df479d288b08c80cf2f1239ccb4e26148d781")
  10. add_versions("v0.5.0", "dac4907aadf39dbd9eac279a214c59ad30af6c0c3d585688242f73cb1a9ce243")
  11. on_install(function (package)
  12. os.cp("dbg.h", package:installdir("include"))
  13. end)
  14. on_test(function (package)
  15. assert(package:check_cxxsnippets({test = [[
  16. void test()
  17. {
  18. int a = 1;
  19. long b = 2;
  20. dbg(a);
  21. dbg(b);
  22. dbg(&a);
  23. }
  24. ]]}, {configs = {languages = "c++17"}, includes = { "dbg.h" } }))
  25. end)