xmake.lua 1.2 KB

123456789101112131415161718192021222324252627282930
  1. package("limonp")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/yanyiwu/limonp")
  4. set_description("C++ headers(hpp) library with Python style.")
  5. set_license("MIT")
  6. add_urls("https://github.com/yanyiwu/limonp/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/yanyiwu/limonp.git")
  8. add_versions("v1.0.1", "c7b18794f020dbaa1006229b49a39217a463da0cb3586aee83eb7471f4ae71df")
  9. add_versions("v1.0.0", "57c088a10ceda774e05281b1fc7779455af2cc824969e331874871822452e24f")
  10. add_versions("v0.9.0", "92d90b262ab2e3375dd386731deeb028f88ee7d07d0695d53d10bef6887d2f5f")
  11. add_deps("cmake")
  12. on_install(function (package)
  13. io.replace("CMakeLists.txt", "ADD_SUBDIRECTORY(test)", "", {plain = true})
  14. local configs = {}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  16. import("package.tools.cmake").install(package, configs)
  17. end)
  18. on_test(function (package)
  19. assert(package:check_cxxsnippets({test = [[
  20. void test() {
  21. limonp::StringFormat("format");
  22. }
  23. ]]}, {configs = {languages = "c++11"}, includes = "limonp/StringUtil.hpp"}))
  24. end)