Skip to content

Commit

Permalink
update sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
matteriot committed Sep 3, 2023
1 parent ad4f704 commit 90a938b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/builddylib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ export CFLAGS="-arch x86_64 -miphoneos-version-min=9.0 -isysroot "$(xcrun -sdk i
export CGO_LDFLAGS="-arch x86_64 -miphoneos-version-min=9.0 -isysroot "$(xcrun -sdk iphonesimulator --show-sdk-path)
CGO_ENABLED=1 GOARCH=amd64 GOOS=ios CC="clang $CFLAGS $CGO_LDFLAGS" go build -tags ios -ldflags=-w -trimpath -o "./build/ios/gateway_simulator_amd64.a" -buildmode c-archive

lipo -create ./build/ios/gateway_arm64.a ./build/ios/gateway_simulator_amd64.a -output ./build/ios/gateway_amd64_arm64.a
lipo -create ./build/ios/gateway_arm64.a ./build/ios/gateway_simulator_amd64.a -output ./build/ios/libgateway_amd64_arm64.a

#Mac
# shellcheck disable=SC2155
export CFLAGS="-mmacosx-version-min=10.9 -isysroot "$(xcrun -sdk macosx --show-sdk-path)
# shellcheck disable=SC2155
export CGO_LDFLAGS="-mmacosx-version-min=10.9 -isysroot "$(xcrun -sdk macosx --show-sdk-path)
#CGO_ENABLED=1 GOARCH=amd64 GOOS=darwin CC="clang $CFLAGS $CGO_LDFLAGS" go build -tags macosx -ldflags=-w -trimpath -o "test.a" -buildmode c-archive
CGO_ENABLED=1 GOARCH=amd64 GOOS=darwin CC="clang $CFLAGS $CGO_LDFLAGS" go build -tags macosx -ldflags=-w -trimpath -o "./build/macos/gateway_amd64.dylib" -buildmode c-shared
CGO_ENABLED=1 GOARCH=arm64 GOOS=darwin CC="clang $CFLAGS $CGO_LDFLAGS" go build -tags macosx -ldflags=-w -trimpath -o "./build/macos/gateway_arm64.dylib" -buildmode c-shared
CGO_ENABLED=1 GOARCH=amd64 GOOS=darwin CC="clang $CFLAGS $CGO_LDFLAGS" go build -tags macosx -ldflags=-w -trimpath -o "./build/macos/gateway_amd64.a" -buildmode c-archive
CGO_ENABLED=1 GOARCH=arm64 GOOS=darwin CC="clang $CFLAGS $CGO_LDFLAGS" go build -tags macosx -ldflags=-w -trimpath -o "./build/macos/gateway_arm64.a" -buildmode c-archive

lipo -create ./build/macos/gateway_amd64.a ./build/macos/gateway_arm64.a -output ./build/macos/libgateway_amd64_arm64.a

0 comments on commit 90a938b

Please sign in to comment.