xmake.lua 1.2 KB

1234567891011121314151617181920212223242526
  1. package("taywee_args")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://taywee.github.io/args/")
  4. set_description("A simple header-only C++ argument parser library.")
  5. set_license("MIT")
  6. add_urls("https://github.com/Taywee/args/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/Taywee/args.git")
  8. add_versions("6.3.0", "e072c4a9d6990872b0ecb45480a5487db82e0dc3d27c3c3eb9fc0930c0d796ae")
  9. add_versions("6.4.6", "41ed136bf9b216bf5f18b1de2a8d22a870381657e8427d6621918520b6e2239c")
  10. on_install(function (package)
  11. os.cp("args.hxx", package:installdir("include"))
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. void test(int argc, char** argv) {
  16. args::ArgumentParser parser("This is a test program.", "This goes after the options.");
  17. args::HelpFlag help(parser, "help", "Display this help menu", {'h', "help"});
  18. args::CompletionFlag completion(parser, {"complete"});
  19. parser.ParseCLI(argc, argv);
  20. }
  21. ]]}, {configs = {languages = "c++11"}, includes = "args.hxx"}))
  22. end)