-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8407f59
commit 8fe6c7b
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,4 +65,4 @@ buck-out/ | |
|
||
|
||
#libsnrk | ||
/depends/libsnrk-optimization/ | ||
/depends/libsanrk-optimization/ |
Submodule libsnark-optimization
added at
f8b0b1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
WORKING_DIR="${__dir}/.." | ||
LIBSNARK_DIR="${WORKING_DIR}/depends/libsnark-optimization" | ||
|
||
ANDROID_API_LEVEL=23 | ||
ANDROID_NDK=20.0.5594570 | ||
BUILD_TYPE=release | ||
|
||
echo "WORKING_DIR: $WORKING_DIR" | ||
echo "LIBSNARK_DIR: $LIBSNARK_DIR" | ||
|
||
printf "\n" | ||
echo " * Generates libc++_shared.so" | ||
printf "\n" | ||
|
||
cd "${LIBSNARK_DIR}" || { echo "Cannot find ${LIBSNARK_DIR}"; exit 1; } && make release=yes android | ||
|
||
cp ~/Library/Android/sdk/ndk/${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so \ | ||
${WORKING_DIR}/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so | ||
|
||
printf "\n" | ||
echo " * Generates libSnark_arm64.a" | ||
printf "\n" | ||
|
||
mkdir -p ${WORKING_DIR}/android/o-files | ||
cd ${WORKING_DIR}/android/o-files || { echo "Cannot find ${LIBSNARK_DIR}/o-files"; exit 1; } | ||
|
||
~/Library/Android/sdk/ndk/${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar -x -v \ | ||
${LIBSNARK_DIR}/lib/android_${BUILD_TYPE}/lib/libSnark_arm64.a | ||
|
||
printf "\n" | ||
echo " * Generates libSnark.so" | ||
printf "\n" | ||
|
||
|
||
~/Library/Android/sdk/ndk/${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android${ANDROID_API_LEVEL}-clang++ \ | ||
-v -flto -fuse-ld=gold -shared *.o \ | ||
-L../app/src/main/jniLibs/arm64-v8a \ | ||
-lssl -lcrypto -lgmp -lomp -lc++_shared -ldl -llog \ | ||
-o ../app/src/main/jniLibs/arm64-v8a/libSnark.so | ||
|
||
cd ${WORKING_DIR} || { echo "Cannot find ${WORKING_DIR}"; exit 1; } | ||
|
||
echo "finish!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
WORKING_DIR="${__dir}/.." | ||
LIBSNARK_DIR="${WORKING_DIR}/depends/libsnark-optimization" | ||
IOS_DIR="${WORKING_DIR}/ios" | ||
|
||
echo "$WORKING_DIR" | ||
echo "$LIBSNARK_DIR" | ||
|
||
echo "WORKING_DIR: $WORKING_DIR" | ||
echo "LIBSNARK_DIR: $LIBSNARK_DIR" | ||
|
||
cd "${LIBSNARK_DIR}" || { echo "Cannot find ${LIBSNARK_DIR}"; exit 1; } && make release=yes ios | ||
|
||
mkdir -p ${IOS_DIR}/native_libs/iphoneos_release | ||
mkdir -p ${IOS_DIR}/native_libs/iphonesimulator_release | ||
mkdir -p ${IOS_DIR}/native_libs/iphoneos_debug | ||
mkdir -p ${IOS_DIR}/native_libs/iphonesimulator_debug | ||
|
||
cp ${LIBSNARK_DIR}/lib/ios_release/lib/libSnark_iphoneos.a ${IOS_DIR}/native_libs/iphoneos_release/libSnark.a | ||
cp ${LIBSNARK_DIR}/lib/ios_release/lib/libSnark_iphonesimulator.a ${IOS_DIR}/native_libs/iphonesimulator_release/libSnark.a | ||
|
||
cp ${LIBSNARK_DIR}/lib/ios_debug/lib/libSnark_iphoneos.a ${IOS_DIR}/native_libs/iphoneos_debug/libSnark.a | ||
cp ${LIBSNARK_DIR}/lib/ios_debug/lib/libSnark_iphonesimulator.a ${IOS_DIR}/native_libs/iphonesimulator_debug/libSnark.a | ||
|
||
cd ${WORKING_DIR} || { echo "Cannot find ${WORKING_DIR}"; exit 1; } | ||
|
||
echo "finish!" |