fix ipaddress config (#5516)

autoupdate-shaderc-v2024.3
Luffbee 1 month ago committed by GitHub
parent f27605d64d
commit 9f07bca37c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 27
      packages/v/vladimirshaleev-ipaddress/xmake.lua

@ -16,6 +16,21 @@ package("vladimirshaleev-ipaddress")
add_deps("cmake")
on_load(function (package)
if not package:config("exceptions") then
package:add("defines", "IPADDRESS_NO_EXCEPTIONS")
end
if not package:config("overload_std") then
package:add("defines", "IPADDRESS_NO_OVERLOAD_STD")
end
if not package:config("ipv6_scope") then
package:add("defines", "IPADDRESS_NO_IPV6_SCOPE")
package:add("defines", "IPADDRESS_IPV6_SCOPE_MAX_LENGTH=0")
else
package:add("defines", "IPADDRESS_IPV6_SCOPE_MAX_LENGTH=" .. package:config("ipv6_scope_max_length"))
end
end)
on_install(function(package)
local configs = {"-DBUILD_TESTING=OFF", "-DIPADDRESS_ENABLE_CLANG_TIDY=OFF", "-DIPADDRESS_BUILD_TESTS=OFF",
"-DIPADDRESS_BUILD_BENCHMARK=OFF", "-DIPADDRESS_BUILD_DOC=OFF",
@ -33,6 +48,7 @@ package("vladimirshaleev-ipaddress")
end)
on_test(function(package)
if package:config("overload_std") then
assert(package:check_cxxsnippets({test = [[
#include <iostream>
#include <ipaddress/ipaddress.hpp>
@ -48,4 +64,15 @@ package("vladimirshaleev-ipaddress")
}
]]
}, {configs = {languages = "c++17"}}))
else
assert(package:check_cxxsnippets({test = [[
#include <ipaddress/ipaddress.hpp>
using namespace ipaddress;
auto test_no_overload() {
constexpr auto ip = ipv6_address::parse("fec0::1ff:fe23:4567:890a%eth2");
return ip;
}
]]
}, {configs = {languages = "c++17"}}))
end
end)

Loading…
Cancel
Save