diff --git a/Makefile b/Makefile index c4da421eb1..ac8d75adcf 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ GOBIND=env PATH="$(GOBIN):$(PATH)" "$(GOMOBILE)" bind IMPORT_HOST=github.com IMPORT_PATH=$(IMPORT_HOST)/Jigsaw-Code/outline-client -.PHONY: android apple linux windows browser +.PHONY: android apple linux windows all: android apple linux windows @@ -35,9 +35,6 @@ $(BUILDDIR)/apple/Tun2socks.xcframework: $(BUILDDIR)/ios/Tun2socks.xcframework $ find $^ -name "Tun2socks.framework" -type d | xargs -I {} echo " -framework {} " | \ xargs xcrun xcodebuild -create-xcframework -output "$@" -browser: - echo "Browser target not needed for tun2socks" - XGO=$(GOBIN)/xgo TUN2SOCKS_VERSION=v1.16.11 XGO_LDFLAGS='-w -X main.version=$(TUN2SOCKS_VERSION)' diff --git a/src/tun2socks/build.action.mjs b/src/tun2socks/build.action.mjs index 86d4fb8900..c91c9889e6 100644 --- a/src/tun2socks/build.action.mjs +++ b/src/tun2socks/build.action.mjs @@ -27,8 +27,18 @@ export async function main(...parameters) { const currentPlatform = os.platform() === 'win32' ? 'windows' : os.platform(); + if (targetPlatform === 'browser') { + return; + } + if (targetPlatform === currentPlatform && ['linux', 'windows'].includes(targetPlatform)) { - return spawnStream('go', 'build', '-o', `output/build/${targetPlatform}/tun2socks`, 'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron'); + return spawnStream( + 'go', + 'build', + '-o', + `output/build/${targetPlatform}/tun2socks`, + 'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron' + ); } await spawnStream('make', ['ios', 'macos', 'maccatalyst'].includes(targetPlatform) ? 'apple' : targetPlatform);