xmake.lua 1007 B

1234567891011121314151617181920212223242526
  1. package("strtk")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://www.partow.net/programming/strtk/index.html")
  4. set_description("C++ String Toolkit Library")
  5. set_license("MIT")
  6. add_urls("https://github.com/ArashPartow/strtk.git")
  7. add_versions("2020.01.01", "d2b446bf1f7854e8b08f5295ec6f6852cae066a2")
  8. on_install(function (package)
  9. os.cp("strtk.hpp", package:installdir("include"))
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. #define strtk_no_tr1_or_boost
  14. #include <strtk.hpp>
  15. void test() {
  16. std::string s = "abc|123|xyz|789";
  17. strtk::single_delimiter_predicate<std::string::value_type> predicate('|');
  18. strtk::std_string::tokenizer<>::type tokenizer(s,predicate);
  19. strtk::std_string::tokenizer<>::type::iterator itr = tokenizer.begin();
  20. }
  21. ]]}, {configs = {languages = "c++14"}}))
  22. end)