xmake.lua 1.3 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. add_urls("https://github.com/cppp-project/cppp-reiconv/releases/download/$(version)/cppp-reiconv-$(version).zip")
  5. add_versions("v2.1.0", "3e539785a437843793c5ce2f8a72cb08f2b543cba11635b06db25cfc6d9cc3a4")
  6. add_deps("cmake", "python")
  7. on_install(function (package)
  8. local configs = {}
  9. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  10. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  11. table.insert(configs, "-DENABLE_EXTRA=ON")
  12. table.insert(configs, "-DENABLE_TEST=OFF")
  13. import("package.tools.cmake").install(package, configs)
  14. end)
  15. on_test(function (package)
  16. assert(package:check_cxxsnippets({test = [[
  17. #include <cppp/reiconv.hpp>
  18. #include <iostream>
  19. #include <cstdlib>
  20. using namespace cppp::base::reiconv;
  21. void test()
  22. {
  23. iconv_t cd = iconv_open("UTF-8", "UTF-8");
  24. if (cd == (iconv_t)(-1))
  25. {
  26. abort();
  27. }
  28. iconv_close(cd);
  29. }
  30. ]]}, {configs = {languages = "c++14"}}))
  31. end)