Ver Fonte

add taywee_args (#1192)

* add taywee_args

* default libomp to shared

* remove redundant args
Hoildkv há 3 anos atrás
pai
commit
34e13b2642
2 ficheiros alterados com 27 adições e 0 exclusões
  1. 2 0
      packages/l/libomp/xmake.lua
  2. 25 0
      packages/t/taywee_args/xmake.lua

+ 2 - 0
packages/l/libomp/xmake.lua

@@ -8,6 +8,8 @@ package("libomp")
     add_versions("11.1.0", "d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e")
     add_versions("12.0.1", "60fe79440eaa9ebf583a6ea7f81501310388c02754dbe7dc210776014d06b091")
 
+    add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"})
+
     add_deps("cmake")
 
     add_links("omp")

+ 25 - 0
packages/t/taywee_args/xmake.lua

@@ -0,0 +1,25 @@
+package("taywee_args")
+
+    set_kind("library", {headeronly = true})
+    set_homepage("https://taywee.github.io/args/")
+    set_description("A simple header-only C++ argument parser library.")
+    set_license("MIT")
+
+    add_urls("https://github.com/Taywee/args/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/Taywee/args.git")
+    add_versions("6.3.0", "e072c4a9d6990872b0ecb45480a5487db82e0dc3d27c3c3eb9fc0930c0d796ae")
+
+    on_install(function (package)
+        os.cp("args.hxx", package:installdir("include"))
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            void test(int argc, char** argv) {
+                args::ArgumentParser parser("This is a test program.", "This goes after the options.");
+                args::HelpFlag help(parser, "help", "Display this help menu", {'h', "help"});
+                args::CompletionFlag completion(parser, {"complete"});
+                parser.ParseCLI(argc, argv);
+            }
+        ]]}, {configs = {languages = "c++11"}, includes = "args.hxx"}))
+    end)