#! /bin/bash
kv4cj_path=$(cd `dirname $0`; pwd)
if [ ! -d "${kv4cj_path}/lib/" ];then
mkdir ${kv4cj_path}/lib
echo "Please copy libcore.so to the folder ${kv4cj_path}/lib."
exit 1
fi
if [ ! -f "${kv4cj_path}/lib/libcore.so" ];then
echo "Please copy libcore.so to the folder ${kv4cj_path}/lib."
exit 1
fi
cd ${kv4cj_path}/mmkv_cpp
if [ -f "Makefile" ];then
make clean
fi
./configure --cxx="/usr1/ohos/native/llvm/bin/clang++" --cross-prefix="/usr1/ohos/native/llvm/bin/llvm-" \
--target=aarch64-linux-ohos \
--cxxflags="--sysroot=/usr1/ohos/native/sysroot"
make
cd ${kv4cj_path}/
echo start build kv4cj
cjpm build -V --target=aarch64-linux-ohos
cp ${kv4cj_path}/lib/*.so ${kv4cj_path}/target/aarch64-linux-ohos/release/kv4cj/
echo end build kv4cj