xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. package("pugixml")
  2. set_homepage("https://pugixml.org/")
  3. set_description("Light-weight, simple and fast XML parser for C++ with XPath support")
  4. set_license("MIT")
  5. add_urls("https://github.com/zeux/pugixml/archive/$(version).tar.gz",
  6. "https://github.com/zeux/pugixml.git")
  7. add_versions("v1.11.4", "017139251c122dbff400a507cddc4cb74120a431a50c6c524f30edcc5b331ade")
  8. add_versions("v1.13", "5c5ad5d7caeb791420408042a7d88c2c6180781bf218feca259fd9d840a888e1")
  9. add_versions("v1.14", "610f98375424b5614754a6f34a491adbddaaec074e9044577d965160ec103d2e")
  10. add_deps("cmake")
  11. on_install(function (package)
  12. local configs = {}
  13. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  14. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  15. if package:is_plat("windows") then
  16. table.insert(configs, "-DSTATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  17. end
  18. import("package.tools.cmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:check_cxxsnippets({test = [[
  22. void test() {
  23. pugi::xml_document doc;
  24. pugi::xpath_node_set nset;
  25. }
  26. ]]}, {configs = {languages = "c++11"}, includes = "pugixml.hpp"}))
  27. end)