-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added arm64 to support Apple M1 and now using small proto lib
- Loading branch information
Showing
11 changed files
with
312 additions
and
809 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
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 |
---|---|---|
@@ -1,20 +1,39 @@ | ||
DARWIN_OUTPUT?=darwin | ||
DARWIN_BINDING_OUTPUT?=$(BINDING_OUTPUT)/$(DARWIN_OUTPUT) | ||
DARWIN_TARGET?=10.11 | ||
binding_darwin: binding_darwin_x86_64 | ||
|
||
binding_darwin: binding_darwin_x86_64 binding_darwin_arm64 | ||
lipo $(DARWIN_BINDING_OUTPUT)/x86_64.dylib $(DARWIN_BINDING_OUTPUT)/arm64.dylib -create -output $(DARWIN_BINDING_OUTPUT)/$(BINDING_NAME).dylib | ||
rm $(DARWIN_BINDING_OUTPUT)/x86_64.dylib $(DARWIN_BINDING_OUTPUT)/arm64.dylib $(DARWIN_BINDING_OUTPUT)/*.h | ||
|
||
binding_darwin_x86_64: | ||
BINDING_FILE=$(DARWIN_OUTPUT)/$(BINDING_NAME).dylib \ | ||
BINDING_FILE=$(DARWIN_OUTPUT)/x86_64.dylib \ | ||
BUILD_MODE="c-shared" \ | ||
CGO_CFLAGS=-mmacosx-version-min=$(DARWIN_TARGET) \ | ||
MACOSX_DEPLOYMENT_TARGET=$(DARWIN_TARGET) \ | ||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 \ | ||
make binding | ||
|
||
binding_darwin_arm64: | ||
BINDING_FILE=$(DARWIN_OUTPUT)/arm64.dylib \ | ||
BUILD_MODE="c-shared" \ | ||
CGO_CFLAGS=-mmacosx-version-min=$(DARWIN_TARGET) \ | ||
MACOSX_DEPLOYMENT_TARGET=$(DARWIN_TARGET) \ | ||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 \ | ||
make binding | ||
|
||
binding_darwin_archive_x86_64: | ||
BINDING_FILE=$(DARWIN_OUTPUT)/$(BINDING_NAME).a \ | ||
BINDING_FILE=$(DARWIN_OUTPUT)/x86_64.a \ | ||
BUILD_MODE="c-archive" \ | ||
CGO_CFLAGS=-mmacosx-version-min=$(DARWIN_TARGET) \ | ||
MACOSX_DEPLOYMENT_TARGET=$(DARWIN_TARGET) \ | ||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 \ | ||
make binding | ||
|
||
binding_darwin_archive_arm64: | ||
BINDING_FILE=$(DARWIN_OUTPUT)/arm64.a \ | ||
BUILD_MODE="c-archive" \ | ||
CGO_CFLAGS=-mmacosx-version-min=$(DARWIN_TARGET) \ | ||
MACOSX_DEPLOYMENT_TARGET=$(DARWIN_TARGET) \ | ||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 \ | ||
make binding |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.PHONY: wasm | ||
wasm: | ||
mkdir -p output/wasm | ||
GOARCH=wasm GOOS=js go build -ldflags="-s -w" -o output/wasm/rsa.wasm wasm/main.go | ||
cd wasm && GOARCH=wasm GOOS=js go build -ldflags="-s -w" -o ../output/wasm/rsa.wasm main.go | ||
cp $(GOROOT)/misc/wasm/wasm_exec.js output/wasm/wasm_exec.js | ||
cp output/wasm/rsa.wasm wasm/sample/public/rsa.wasm | ||
cp output/wasm/wasm_exec.js wasm/sample/public/wasm_exec.js |
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
Oops, something went wrong.