} -ne 0 ]
then
exit -1
fi
```
* **HPKBUILD解析,**
* **CMAKE 例子,用cJSON做例子 **
```
# Contributor: Jeff Han <hanjinfei@foxmail.com>
# Maintainer: Jeff Han <hanjinfei@foxmail.com>
source envset.sh
host=
prepare() {
mkdir $pkgname-$ARCH-build
tar -jxf $packagename -C $pkgname-$ARCH-build
if [ $ARCH == "armeabi-v7a" ]
then
setarm32ENV
host=arm-linux
fi
if [ $ARCH == "arm64-v8a" ]
then
setarm64ENV
host=aarch64-linux
fi
cd $pkgname-$ARCH-build/$builddir
./bootstrap > `pwd`/build.log 2>&1
cd $OLDPWD
}
build() {
cd $pkgname-$ARCH-build/$builddir
./configure "$@" --host=$host --enable-debug --enable-automated --enable-basic --enable-console --enable-examples --enable-test >> `pwd`/build.log 2>&1
make -j4 >> `pwd`/build.log 2>&1
ret=$?
cd $OLDPWD
return $ret
}
package() {
cd $pkgname-$ARCH-build/$builddir
make install >> `pwd`/build.log 2>&1
cd $OLDPWD
if [ $ARCH == "armeabi-v7a" ]
then
unsetarm32ENV
fi
if [ $ARCH == "arm64-v8a" ]
then
unsetarm64ENV
fi
unset host
}
check() {
echo "The test must be on an OpenHarmony device!"
# 在OpenHarmony开发板中执行用例
# ./test_cunit
}