xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829
  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/v$(version).tar.gz")
  6. add_versions("1.11.4", "017139251c122dbff400a507cddc4cb74120a431a50c6c524f30edcc5b331ade")
  7. add_deps("cmake")
  8. on_install("windows", "linux", "macosx", function (package)
  9. local configs = {}
  10. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  11. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  12. if package:is_plat("windows") then
  13. table.insert(configs, "-DSTATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  14. end
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. void test() {
  20. pugi::xml_document doc;
  21. pugi::xpath_node_set nset;
  22. }
  23. ]]}, {configs = {languages = "c++11"}, includes = "pugixml.hpp"}))
  24. end)