Commit b9d71c13 authored by “李磊”'s avatar “李磊”
Browse files

fix: 安卓下无法编译出静态库

parent 7af85b1f
......@@ -10,17 +10,10 @@ arm:
export GOARCH=arm GOOS=linux GO111MODULE=on CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc && go build -buildmode=c-shared -o $(DST) $(SRC)
android:
export GOARCH=arm GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi19-clang && go build -buildmode=c-shared -o $(DST) $(SRC)
export GOARCH=arm GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi19-clang && go build -buildmode=c-shared -tags netcgo -o $(DST) $(SRC)
android-64:
export GOARCH=arm64 GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang && go build -buildmode=c-shared -o $(DST) $(SRC)
export GOARCH=arm64 GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang && go build -buildmode=c-shared -tags netcgo -o $(DST) $(SRC)
android-static:
export GOARCH=arm GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi19-clang && go build -buildmode=c-shared -o $(DST2) $(SRC)
android-static-64:
export GOARCH=arm64 GOOS=android GO111MODULE=on CGO_ENABLED=1 CC=/usr/local/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang && go build -buildmode=c-shared -o $(DST2) $(SRC)
P.HONY: clean
.PHONY: clean
clean:
rm -f lib/*
......@@ -15,7 +15,7 @@ import (
)
//export start
func start() {
func start(root string) {
dir, err := os.Getwd()
if err != nil {
LogError("MainActivity", dir)
......@@ -28,6 +28,10 @@ func start() {
LogInfo("MainActivity", exePath)
RootDir = GetCurrentDirectory()
if RootDir == "/" {
RootDir = root
}
LogInfo("MainActivity", RootDir)
msg := ""
for {
if file.Exists(filepath.Join(RootDir, agentFileName)) {
......
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