2
0

xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package("cppp-reiconv")
  2. set_homepage("https://github.com/cppp-project/cppp-reiconv")
  3. set_description("A character set conversion library based on GNU LIBICONV.")
  4. set_license("LGPL-3.0")
  5. add_urls("https://github.com/cppp-project/cppp-reiconv/releases/download/$(version)/cppp-reiconv-$(version).zip",
  6. "https://github.com/cppp-project/cppp-reiconv.git")
  7. add_versions("v2.1.0", "3e539785a437843793c5ce2f8a72cb08f2b543cba11635b06db25cfc6d9cc3a4")
  8. add_patches("2.1.0", "patches/2.1.0/cmake.patch", "21bd2fcb5874f8774af1360aaac51073b67bf4c754096f0fe162d66632c1b7f9")
  9. add_deps("cmake", "python")
  10. on_install(function (package)
  11. local configs = {"-DENABLE_TEST=OFF", "-DENABLE_EXTRA=ON"}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:check_cxxsnippets({test = [[
  18. #include <cppp/reiconv.hpp>
  19. #include <iostream>
  20. #include <cstdlib>
  21. using namespace cppp::base::reiconv;
  22. void test()
  23. {
  24. iconv_t cd = iconv_open("UTF-8", "UTF-8");
  25. if (cd == (iconv_t)(-1))
  26. {
  27. abort();
  28. }
  29. iconv_close(cd);
  30. }
  31. ]]}, {configs = {languages = "c++14"}}))
  32. end)