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

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

parent 7af85b1f
...@@ -10,17 +10,10 @@ arm: ...@@ -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) export GOARCH=arm GOOS=linux GO111MODULE=on CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc && go build -buildmode=c-shared -o $(DST) $(SRC)
android: 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: 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)
.PHONY: clean
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
clean: clean:
rm -f lib/* rm -f lib/*
...@@ -15,7 +15,7 @@ import ( ...@@ -15,7 +15,7 @@ import (
) )
//export start //export start
func start() { func start(root string) {
dir, err := os.Getwd() dir, err := os.Getwd()
if err != nil { if err != nil {
LogError("MainActivity", dir) LogError("MainActivity", dir)
...@@ -28,6 +28,10 @@ func start() { ...@@ -28,6 +28,10 @@ func start() {
LogInfo("MainActivity", exePath) LogInfo("MainActivity", exePath)
RootDir = GetCurrentDirectory() RootDir = GetCurrentDirectory()
if RootDir == "/" {
RootDir = root
}
LogInfo("MainActivity", RootDir)
msg := "" msg := ""
for { for {
if file.Exists(filepath.Join(RootDir, agentFileName)) { 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