Skip to content

Commit

Permalink
Adjusting path for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Simbad Marino authored and Simbad Marino committed Oct 15, 2022
1 parent da5f802 commit 151b5ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 82 deletions.
16 changes: 11 additions & 5 deletions cmd/btfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ANDROID_OUT=./jniLibs
ANDROID_SDK=$(HOME)/Library/Android/sdk
NDK_BIN=$(ANDROID_SDK)/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin

WASM_OUT=./wasmBinary

ios-arm64:
CGO_ENABLED=1 \
Expand All @@ -12,7 +12,7 @@ ios-arm64:
SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk \
CC=$(PWD)/clangwrap.sh \
CGO_CFLAGS="-fembed-bitcode -Wno-undef-prefix" \
go build -buildmode=c-archive -tags ios -o $(IOS_OUT)/arm64.a .
go build -buildmode=c-archive -tags ios -ldflags="-s -w" -o $(IOS_OUT)/arm64.a .

ios-x86_64:
CGO_ENABLED=1 \
Expand All @@ -21,7 +21,7 @@ ios-x86_64:
SDK=iphonesimulator \
CGO_CFLAGS="-Wno-undef-prefix" \
CC=$(PWD)/clangwrap.sh \
go build -buildmode=c-archive -tags ios -o $(IOS_OUT)/x86_64.a .
go build -buildmode=c-archive -tags ios -ldflags="-s -w" -o $(IOS_OUT)/x86_64.a .

ios: ios-arm64 ios-x86_64
lipo $(IOS_OUT)/x86_64.a $(IOS_OUT)/arm64.a -create -output $(IOS_OUT)/btfs.a
Expand All @@ -36,7 +36,7 @@ android-armv7a:
CGO_CFLAGS="-fembed-bitcode" \
CC=$(NDK_BIN)/armv7a-linux-androideabi21-clang \
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o $(ANDROID_OUT)/armeabi-v7a/libbtfs.so .


android-arm64:
CGO_ENABLED=1 \
Expand All @@ -45,7 +45,7 @@ android-arm64:
CGO_CFLAGS="-fembed-bitcode" \
CC=$(NDK_BIN)/aarch64-linux-android21-clang \
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o $(ANDROID_OUT)/arm64-v8a/libbtfs.so .


android-x86:
CGO_ENABLED=1 \
Expand All @@ -62,3 +62,9 @@ android-x86_64:
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o $(ANDROID_OUT)/x86_64/libbtfs.so .

android: android-armv7a android-arm64 android-x86 android-x86_64

wasm:
CGO_ENABLED=1 \
GOOS=js \
GOARCH=wasm \
go build -o $(WASM_OUT)/btfs.wasm .
75 changes: 0 additions & 75 deletions cmd/btfs/_btfs_fat.h

This file was deleted.

5 changes: 3 additions & 2 deletions repo/fsrepo/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import (
// present, this function returns that value. Otherwise, it returns the default
// repo path.
func BestKnownPath() (string, error) {
btfsPath := "~/Documents/.btfs"
if runtime.GOOS == "darwin" { //TODO: Leave only ./btfs path by defining properly the $HOME dir for iOS in path.go file
btfsPath := "~/Documents/.btfs" //iOS path
btfsPath = "~/Documents/.btfs" //iOS path
}
if runtime.GOOS == "android" {
btfsPath := "~/.btfs" //Android path
btfsPath = "~/.btfs" //Android path
}
if os.Getenv("BTFS_PATH") != "" {
btfsPath = os.Getenv("BTFS_PATH")
Expand Down

0 comments on commit 151b5ab

Please sign in to comment.