Improve darwin tun performance

This commit is contained in:
世界
2025-07-02 19:22:23 +08:00
parent eea1e701b7
commit 6cfa2b8b86
5 changed files with 24 additions and 16 deletions

View File

@@ -46,8 +46,9 @@ var (
sharedFlags []string
debugFlags []string
sharedTags []string
iosTags []string
darwinTags []string
memcTags []string
notMemcTags []string
debugTags []string
)
@@ -62,8 +63,9 @@ func init() {
debugFlags = append(debugFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag)
sharedTags = append(sharedTags, "with_gvisor", "with_quic", "with_wireguard", "with_utls", "with_clash_api", "with_conntrack")
iosTags = append(iosTags, "with_dhcp", "with_low_memory")
darwinTags = append(darwinTags, "with_dhcp")
memcTags = append(memcTags, "with_tailscale")
notMemcTags = append(notMemcTags, "with_low_memory")
debugTags = append(debugTags, "debug")
}
@@ -153,6 +155,7 @@ func buildApple() {
"-v",
"-target", bindTarget,
"-libname=box",
"-tags-not-macos=with_low_memory",
}
if !withTailscale {
args = append(args, "-tags-macos="+strings.Join(memcTags, ","))
@@ -164,7 +167,7 @@ func buildApple() {
args = append(args, debugFlags...)
}
tags := append(sharedTags, iosTags...)
tags := append(sharedTags, darwinTags...)
if withTailscale {
tags = append(tags, memcTags...)
}