diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f601723..cb4532b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,7 @@ jobs: # - { os: "ubuntu-latest", target: "windows-386", aarch: 'x86'} #fultter does not support x86 - { os: "ubuntu-latest", target: "windows-amd64", aarch: 'x64' } - { os: "macos-11", target: "macos-universal" } + - { os: "macos-11", target: "ios" } runs-on: ${{ matrix.job.os }} steps: - name: Checkout @@ -69,7 +70,7 @@ jobs: # ndk-version: '25.2.9519653' - name: Setup GoMobile - if: startsWith(matrix.job.target,'android') + if: startsWith(matrix.job.target,'android') || startsWith(matrix.job.target,'ios') run: make lib_install - name: Setup MinGW diff --git a/Makefile b/Makefile index 611186e..46a6cd2 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ headers: android: gomobile bind -v -androidapi=21 -javapkg=io.nekohasekai -libname=box -tags=$(TAGS) -trimpath -ldflags="-w -s" -target=android -o $(BINDIR)/$(NAME)-$@.aar github.com/sagernet/sing-box/experimental/libbox ./mobile +ios: + gomobile bind -v -target ios,iossimulator,tvos,tvossimulator,macos -libname=box -tags=$(TAGS),with_dhcp,with_low_memory,with_conntrack -trimpath -ldflags="-w -s" -o $(BINDIR)/$(NAME)-$@.xcframework github.com/sagernet/sing-box/experimental/libbox ./mobile + windows-amd64: env GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.dll ./custom @@ -27,9 +30,9 @@ linux-386: env GOOS=linux GOARCH=386 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.so ./custom macos-amd64: - env GOOS=darwin GOARCH=amd64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags with_gvisor,with_lwip -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom + env GOOS=darwin GOARCH=amd64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),with_dhcp,with_low_memory,with_conntrack -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom macos-arm64: - env GOOS=darwin GOARCH=arm64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags with_gvisor,with_lwip -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom + env GOOS=darwin GOARCH=arm64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),with_dhcp,with_low_memory,with_conntrack -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom macos-universal: macos-amd64 macos-arm64 lipo -create $(BINDIR)/$(NAME)-macos-amd64.dylib $(BINDIR)/$(NAME)-macos-arm64.dylib -output $(BINDIR)/$(NAME)-$@.dylib