-
-
Save sunsheng/64fa91a1e1033454f3895069a527bd9a to your computer and use it in GitHub Desktop.
shell script to help to build the golang binary for android, use gomobile
This file contains hidden or 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
#!/bin/bash | |
# refer to http://www.sajalkayan.com/post/go-android-binary.html | |
export GOMOBILE="$GOPATH/pkg/gomobile" | |
export GOOS=android | |
export GOARCH=arm | |
export CC=$GOMOBILE/android-ndk-r12b/arm/bin/arm-linux-androideabi-clang | |
export CXX=$GOMOBILE/android-ndk-r12b/arm/bin/arm-linux-androideabi-clang++ | |
export CGO_ENABLED=1 | |
export GOARM=7 | |
go build -p=8 -pkgdir=$GOMOBILE/pkg_android_arm -tags="" -ldflags="-extldflags=-pie" "$@" | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment