diff --git a/.version b/.version index e7ab361..a895281 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.0.20240326 +0.0.20240714 diff --git a/build-platforms.sh b/build-platforms.sh index c134f83..adcbc0e 100755 --- a/build-platforms.sh +++ b/build-platforms.sh @@ -19,6 +19,6 @@ function make_wg_go() { make_wg_go "iphoneos" "arm64-apple-ios15.0" make_wg_go "iphonesimulator" "arm64-apple-ios15.0-simulator" -make_wg_go "macosx" "arm64-apple-macos12.0" +make_wg_go "macosx" "arm64-apple-macos12.0 x86_64-apple-macos12.0" make_wg_go "appletvos" "arm64-apple-tvos17.0" make_wg_go "appletvsimulator" "arm64-apple-tvos17.0-simulator" diff --git a/create-framework.sh b/create-framework.sh index a5d3803..3d03c53 100755 --- a/create-framework.sh +++ b/create-framework.sh @@ -6,8 +6,7 @@ fi PLATFORMS_PATH="build" FRAMEWORK_PATH="$1" -PLATFORMS=("iphoneos" "iphonesimulator" "macosx" "appletvos" "appletvsimulator") -for ARG in ${PLATFORMS[@]}; do +for ARG in `ls $PLATFORMS_PATH`; do ARGS+="-library $PLATFORMS_PATH/$ARG/libwg-go.a " ARGS+="-headers $PLATFORMS_PATH/$ARG/Headers " done diff --git a/src/Makefile b/src/Makefile index f507d48..eab7c34 100644 --- a/src/Makefile +++ b/src/Makefile @@ -18,8 +18,6 @@ DESTDIR ?= $(CONFIGURATION_BUILD_DIR) BUILDDIR ?= $(CONFIGURATION_TEMP_DIR)/wireguard-go-bridge CFLAGS_PREFIX := -isysroot $(SDKROOT) -GOARCH_arm64 := arm64 -GOARCH_x86_64 := amd64 GOOS_macosx := $(if $(IS_CATALYST),ios,darwin) GOOS_iphoneos := ios GOOS_iphonesimulator := ios @@ -43,7 +41,7 @@ $(BUILDDIR)/libwg-go-$(1).a: export CGO_ENABLED := 1 $(BUILDDIR)/libwg-go-$(1).a: export CGO_CFLAGS := $(CFLAGS_PREFIX) -target $(TARGET) $(BUILDDIR)/libwg-go-$(1).a: export CGO_LDFLAGS := $(CFLAGS_PREFIX) -target $(TARGET) $(BUILDDIR)/libwg-go-$(1).a: export GOOS := $(GOOS_$(PLATFORM_NAME)) -$(BUILDDIR)/libwg-go-$(1).a: export GOARCH := $(GOARCH_$(1)) +$(BUILDDIR)/libwg-go-$(1).a: export GOARCH := $(subst x86_64,amd64,$(word 1, $(subst -, ,$(1)))) $(BUILDDIR)/libwg-go-$(1).a: $(GOROOT)/.prepared go.mod go build -ldflags=-w -trimpath -v -o "$(BUILDDIR)/libwg-go-$(1).a" -buildmode c-archive rm -f "$(BUILDDIR)/libwg-go-$(1).h"