Commit c55fd2dd authored by Mygod's avatar Mygod

Refine goBuild speed

parent 3c3406d3
...@@ -56,33 +56,38 @@ export GOROOT=$DIR/go ...@@ -56,33 +56,38 @@ export GOROOT=$DIR/go
export GOPATH=$DIR export GOPATH=$DIR
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
echo "Get dependences for overture" if [ ! -f "$TARGET/armeabi-v7a/liboverture.so" ] || [ ! -f "$TARGET/arm64-v8a/liboverture.so" ] ||
go get -u github.com/tools/godep [ ! -f "$TARGET/x86/liboverture.so" ]; then
pushd $GOPATH/src/github.com/shadowsocks/overture/main echo "Get dependences for overture"
godep restore go get -u github.com/tools/godep
echo "Cross compile overture for arm" pushd $GOPATH/src/github.com/shadowsocks/overture/main
if [ ! -f "$TARGET/armeabi-v7a/liboverture.so" ]; then godep restore
echo "Cross compile overture for arm"
if [ ! -f "$TARGET/armeabi-v7a/liboverture.so" ]; then
try env CGO_ENABLED=1 CC=$ANDROID_ARM_CC GOOS=android GOARCH=arm GOARM=7 go build -ldflags="-s -w" try env CGO_ENABLED=1 CC=$ANDROID_ARM_CC GOOS=android GOARCH=arm GOARM=7 go build -ldflags="-s -w"
try $ANDROID_ARM_STRIP main try $ANDROID_ARM_STRIP main
try mv main $TARGET/armeabi-v7a/liboverture.so try mv main $TARGET/armeabi-v7a/liboverture.so
fi fi
echo "Cross compile overture for arm64" echo "Cross compile overture for arm64"
if [ ! -f "$TARGET/arm64-v8a/liboverture.so" ]; then if [ ! -f "$TARGET/arm64-v8a/liboverture.so" ]; then
try env CGO_ENABLED=1 CC=$ANDROID_ARM64_CC GOOS=android GOARCH=arm64 go build -ldflags="-s -w" try env CGO_ENABLED=1 CC=$ANDROID_ARM64_CC GOOS=android GOARCH=arm64 go build -ldflags="-s -w"
try $ANDROID_ARM64_STRIP main try $ANDROID_ARM64_STRIP main
try mv main $TARGET/arm64-v8a/liboverture.so try mv main $TARGET/arm64-v8a/liboverture.so
fi fi
echo "Cross compile overture for x86" echo "Cross compile overture for x86"
if [ ! -f "$TARGET/x86/liboverture.so" ]; then if [ ! -f "$TARGET/x86/liboverture.so" ]; then
try env CGO_ENABLED=1 CC=$ANDROID_X86_CC GOOS=android GOARCH=386 go build -ldflags="-s -w" try env CGO_ENABLED=1 CC=$ANDROID_X86_CC GOOS=android GOARCH=386 go build -ldflags="-s -w"
try $ANDROID_X86_STRIP main try $ANDROID_X86_STRIP main
try mv main $TARGET/x86/liboverture.so try mv main $TARGET/x86/liboverture.so
fi fi
popd popd
fi
echo "Successfully build overture" echo "Successfully build overture"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment