Skip to content

Commit

Permalink
Auto-update ada to v3.0.1 (#6309)
Browse files Browse the repository at this point in the history
* Update ada to v3.0.1

* Update xmake.lua

* Update xmake.lua
  • Loading branch information
star-hengxing authored Feb 7, 2025
1 parent 7c647df commit 6a27cf3
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/a/ada/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package("ada")
set_urls("https://github.com/ada-url/ada/archive/refs/tags/$(version).tar.gz",
"https://github.com/ada-url/ada.git")

add_versions("v3.0.1", "525890a87a002b1cc14c091800c53dcf4a24746dbfc5e3b8a9c80490daad9263")
add_versions("v2.9.2", "f41575ad7eec833afd9f6a0d6101ee7dc2f947fdf19ae8f1b54a71d59f4ba5ec")
add_versions("v2.9.1", "64eb3d91db941645d1b68ac8d1cbb7b534fbe446b66c1da11e384e17fca975e7")
add_versions("v2.9.0", "8b992f0ce9134cb4eafb74b164d2ce2cb3af1900902162713b0e0c5ab0b6acd8")
Expand All @@ -25,21 +26,40 @@ package("ada")

add_deps("cmake")

if on_check then
on_check("android", function (package)
if package:version() and package:version():ge("3.0.0") then
local ndk = package:toolchain("ndk"):config("ndkver")
assert(ndk and tonumber(ndk) > 22, "package(ada >=3.0.0) require ndk version > 22")
end
end)
end

on_install(function (package)
io.replace("CMakeLists.txt", "add_subdirectory(singleheader)", "", {plain = true})
io.replace("CMakeLists.txt", "add_subdirectory(tools)", "", {plain = true})

io.replace("src/CMakeLists.txt", "/WX", "", {plain = true})

local configs = {"-DBUILD_TESTING=OFF", "-DADA_TOOLS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DADA_SANITIZE=" .. (package:config("asan") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)

on_test(function (package)
local languages
if package:version() and package:version():ge("3.0.0") then
languages = "c++20"
else
languages = "c++17"
end
assert(package:check_cxxsnippets({test = [[
#include <iostream>
#include <ada.h>
void test() {
auto url = ada::parse<ada::url_aggregator>("https://xmake.io");
}
]]}, {configs = {languages = "c++17"}}))
]]}, {configs = {languages = languages}}))
end)

0 comments on commit 6a27cf3

Please sign in to comment.