添加 packages/a/argparse/xmake.lua

This commit is contained in:
KeqingMoe 2025-06-22 09:32:22 +00:00
parent f3dabd3a0a
commit 949f0ea319

View File

@ -0,0 +1,38 @@
package("argparse")
set_kind("library")
set_homepage("https://github.com/p-ranav/argparse")
set_description("A single header argument parser for C++17")
set_license("MIT")
add_config("enable_module", { default = false, type = "boolean" })
add_config("enable_std_import", { default = false, type = "boolean" })
add_urls(-- "https://github.com/p-ranav/argparse/archive/refs/tags/v$(version).zip",
"https://github.com/KeqingMoe/argparse.git")
-- add_versions("3.2", "14c1a0e975d6877dfeaf52a1e79e54f70169a847e29c7e13aa7fe68a3d0ecbf1")
-- add_versions("3.1", "3e5a59ab7688dcd1f918bc92051a10564113d4f36c3bbed3ef596c25e519a062")
-- add_versions("3.0", "674e724c2702f0bfef1619161815257a407e1babce30d908327729fba6ce4124")
-- add_versions("2.6", "ce4e58d527b83679bdcc4adfa852af7ec9df16b76c11637823ef642cb02d2618")
-- add_versions("2.7", "58cf098fd195895aeb9b9120d96f1e310994b2f44d72934c438ec91bf2191f46")
-- add_versions("2.8", "9381b9ec2bdd2a350d1a0bf96d631969e3fda0cf2696e284d1359b5ee4ebb465")
-- add_versions("2.9", "55396ae05d9deb8030b8ad9babf096be9c35652d5822d8321021bcabb25f4b72")
on_install(function (package)
local configs = {}
if package:config("enable_module") then
configs.enable_module = "ENABLE_MODULE"
end
if package:config("enable_std_import") then
configs.enable_std_import = "ENABLE_STD_IMPORT"
end
import("package.tools.xmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
argparse::ArgumentParser test("test");
}
]]}, {configs = {languages = "c++17"}, includes = "argparse/argparse.hpp"}))
end)