xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930
  1. package("zlibcomplete")
  2. set_homepage("https://github.com/rudi-cilibrasi/zlibcomplete")
  3. set_description("C++ interface to the ZLib library supporting compression with FLUSH, decompression, and std::string. RAII")
  4. set_license("MIT")
  5. add_urls("https://github.com/rudi-cilibrasi/zlibcomplete/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/rudi-cilibrasi/zlibcomplete.git")
  7. add_versions("1.0.5", "2b263983823395eaabb091cb9b629eb8466fe24b929bba7ff6d833cadad11977")
  8. add_deps("cmake", "zlib")
  9. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  10. on_install(function (package)
  11. local configs = {}
  12. table.insert(configs, "-DZLIBCOMPLETE_EXAMPLES=off")
  13. table.insert(configs, "-DZLIBCOMPLETE_DOCS=off")
  14. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  15. if package:config("shared") then
  16. table.insert(configs, "-DZLIBCOMPLETE_SHARED=on")
  17. else
  18. table.insert(configs, "-DZLIBCOMPLETE_STATIC=on")
  19. end
  20. import("package.tools.cmake").install(package, configs)
  21. os.cp("lib/zlc/*.hpp", package:installdir("include", "zlc"))
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cxxincludes("zlc/zlibcomplete.hpp"))
  25. end)