package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.7 KiB

package("uriparser")
set_homepage("https://uriparser.github.io/")
set_description("uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C89.")
set_license("BSD-3-Clause")
add_urls("https://github.com/uriparser/uriparser/archive/refs/tags/uriparser-$(version).tar.gz")
add_versions("0.9.8", "d6289387eaf2495e38ed80d709ad673fe04d63fad707badfee96f3d2dabc7c35")
add_versions("0.9.7", "8e19250654a204af0858408b55dc78941382a8c824bf38fc7f2a95ca6e16d7a0")
add_versions("0.9.6", "defaf550bf6fe05e89afb9814dccc6bd643a3b0a8308801a2c04b76682b87383")
add_versions("0.9.5", "dece5067b4517c4b16cde332c491b4b3508249d2a8f4ba393229575d3c5241c0")
add_deps("cmake")
on_load(function (package)
if not package:config("shared") then
package:add("defines", "URI_STATIC_BUILD")
end
end)
on_install("windows", "linux", "macosx", function (package)
local configs = {"-DURIPARSER_BUILD_DOCS=OFF", "-DURIPARSER_BUILD_TESTS=OFF", "-DURIPARSER_BUILD_TOOLS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_plat("windows") then
table.insert(configs, "-DURIPARSER_MSVC_RUNTIME=/" .. package:config("vs_runtime"))
end
if package:config("pic") ~= false then
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
end
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("uriParseSingleUriA", {includes = "uriparser/Uri.h"}))
end)