-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(swiftui): add support for arm64 arch and build universal swiftu…
…i client app We build the go source to static lib of arm64 and amd64 arch and merge them into a single static lib using `lipo` tool. Then we can build and link an universal swiftui client app using `xcodebuild`.
- Loading branch information
Showing
5 changed files
with
34 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# this makefile builds go api into an archive file (static library) | ||
|
||
BUILD_FLAGS=--trimpath -gcflags "-N" | ||
|
||
BUILD_ENVS=CGO_ENABLED=1 CGO_CFLAGS="-mmacosx-version-min=12.1" CGO_CXXFLAGS="-mmacosx-version-min=12.1" CC=clang | ||
|
||
.PHONY: all clean | ||
|
||
all: libwssocks_go_api.a | ||
|
||
libwssocks_go_api_amd64.a: wssocks_client_wrapper.go | ||
$(BUILD_ENVS) GOOS=darwin GOARCH=amd64 go build $(BUILD_FLAGS) --buildmode=c-archive -o libwssocks_go_api_amd64.a | ||
mv libwssocks_go_api_amd64.h libwssocks_go_api.h | ||
|
||
libwssocks_go_api_arm64.a: wssocks_client_wrapper.go | ||
$(BUILD_ENVS) GOOS=darwin GOARCH=arm64 go build $(BUILD_FLAGS) --buildmode=c-archive -o libwssocks_go_api_arm64.a | ||
mv libwssocks_go_api_arm64.h libwssocks_go_api.h | ||
|
||
libwssocks_go_api.a: libwssocks_go_api_amd64.a libwssocks_go_api_arm64.a | ||
lipo libwssocks_go_api_amd64.a libwssocks_go_api_arm64.a -create -output libwssocks_go_api.a | ||
|
||
clean: | ||
rm libwssocks_go_api.a libwssocks_go_api_arm64.a libwssocks_go_api_amd64.a libwssocks_go_api.h |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters