Skip to content

Commit 5dad257

Browse files
committed
Update androidcompile.bat file with minor tweaks.
1 parent 8490a60 commit 5dad257

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/others/android/example/androidcompile.bat

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
)
2121

2222
:COMPILE
23-
@echo compiling for platform %FL%
23+
@echo compiling for platform %FL% and architecture %GOARCH%
2424
@set CGO_CFLAGS="-I%ANDROID_SYSROOT%/usr/include -I%ANDROID_SYSROOT%/usr/include/%TRIPLE% --sysroot=%ANDROID_SYSROOT% -D__ANDROID_API__=%ANDROID_API%"
2525
@set CGO_LDFLAGS="-L%ANDROID_SYSROOT%/usr/lib/%TRIPLE%/%ANDROID_API% -L%ANDROID_TOOLCHAIN%/%TRIPLE%/lib --sysroot=%ANDROID_SYSROOT%"
2626
@set CGO_ENABLED=1
2727
@set GOOS=android
28-
@set GOARCH=arm
28+
@set GOARCH=%GOARCH%
2929
@go build -buildmode=c-shared -ldflags="-s -w -extldflags=-Wl,-soname,lib%LIBRARY_NAME%.so" -o=android/libs/%FL%/lib%LIBRARY_NAME%.so
3030
@EXIT /B
3131

@@ -48,21 +48,21 @@
4848
@set GOARCH=arm
4949
@CALL:COMPILE )
5050
@IF %TARGET_ARCH% == "arm64-v8a" (
51-
@set CC="armv7a-linux-androideabi%ANDROID_API%-clang"
51+
@set CC="aarch64-linux-android%ANDROID_API%-clang"
5252
@set TRIPLE=aarch64-linux-android
5353
@set FL=arm64-v8a
5454
@set GOARCH=arm64
5555
@CALL:COMPILE )
5656
@IF %TARGET_ARCH% == "x86" (
57-
@set CC="armv7a-linux-androideabi%ANDROID_API%-clang"
57+
@set CC="i686-linux-android%ANDROID_API%-clang"
5858
@set TRIPLE=i686-linux-android
5959
@set FL=x86
60-
@set GOARCH=arm
60+
@set GOARCH=386
6161
@CALL:COMPILE )
6262
@IF %TARGET_ARCH% == "x86_64" (
63-
@set CC="armv7a-linux-androideabi%ANDROID_API%-clang"
63+
@set CC="x86_64-linux-android%ANDROID_API%-clang"
6464
@set TRIPLE=x86_64-linux-android
6565
@set FL=x86_64
66-
@set GOARCH=arm64
66+
@set GOARCH=amd64
6767
@CALL:COMPILE )
6868
@EXIT /B

0 commit comments

Comments
 (0)