xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("graaf")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://bobluppes.github.io/graaf/")
  4. set_description("A general-purpose lightweight C++ graph library")
  5. set_license("MIT")
  6. add_urls("https://github.com/bobluppes/graaf/releases/download/$(version)/header-only.tar.gz",
  7. "https://github.com/bobluppes/graaf.git")
  8. add_versions("v1.1.1", "86a95e14aa18f81ea31ec0764ef8b12d1fe42396da3be0046e0dbbb562fb3c89")
  9. if on_check then
  10. on_check(function (package)
  11. assert(package:check_cxxsnippets({test = [[
  12. enum class fruit { orange, apple };
  13. void test() {
  14. using enum fruit;
  15. }
  16. ]]}, {configs = {languages = "c++20"}}), "package(graaf) Require at least C++20.")
  17. end)
  18. end
  19. on_install(function (package)
  20. if package:gitref() then
  21. os.cp("include", package:installdir())
  22. else
  23. os.cp("graaflib", package:installdir("include"))
  24. end
  25. end)
  26. on_test(function (package)
  27. assert(package:check_cxxsnippets({test = [[
  28. void test() {
  29. graaf::directed_graph<int, int> graph{};
  30. }
  31. ]]}, {configs = {languages = "c++20"}, includes = "graaflib/graph.h"}))
  32. end)