xmake.lua 1.0 KB

123456789101112131415161718192021222324252627
  1. package("base-n")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/azawadzki/base-n")
  4. set_description("A small, single-header library which provides standard Base16, Base32, Base64, and custom Base-N encoding support.")
  5. set_license("MIT")
  6. add_urls("https://github.com/azawadzki/base-n.git")
  7. add_versions("2020.05.28", "7573e77c0b9b0e8a5fb63d96dbde212c921993b4")
  8. on_install(function (package)
  9. os.cp("include/basen.hpp", package:installdir("include"))
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. #include <string>
  14. #include <iostream>
  15. #include <basen.hpp>
  16. void test () {
  17. std::string in = "test";
  18. std::string encoded;
  19. bn::encode_b64(in.begin(), in.end(), back_inserter(encoded));
  20. std::cout << encoded << std::endl;
  21. }
  22. ]]}, {configs = {languages = "c++11"}, includes = "basen.hpp"}))
  23. end)