Skip to content

Commit

Permalink
FIX: issues ShiqiYu#222
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Mar 24, 2020
1 parent d3eed41 commit 5b35c76
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ It should be compiled at any platform which support C/C++.

Some tips:

* Please add -DFACEDETECTION_EXPORT to gcc/g++ flags or add /DFACEDETECTION_EXPORT to Microsoft Visual Studio(cl). See: issues #222
* Please add -O3 to turn on optimizations when you compile the source code using g++.
* Please choose 'Maximize Speed/-O2' when you compile the source code using Microsoft Visual Studio.
* You can enable OpenMP to speedup. But the best solution is to call the detection function in different threads.
Expand Down
37 changes: 37 additions & 0 deletions build_android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

if [ -n "$1" ]; then
ANDROID_NDK=$1
fi
if [ -z "${ANDROID_NDK}" ]; then
echo "$0 ANDROID_NDK"
exit -1
fi

if [ -z "${ANDROID_STL}" ]; then
ANDROID_STL=c++_static
fi

if [ ! -d build_android ]; then
mkdir -p build_android
fi
cd build_android

cmake .. -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DANDROID_ABI="arm64-v8a" \
-DANDROID_ARM_NEON=ON \
-DANDROID_PLATFORM=android-24 \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
-DANDROID_STL=${ANDROID_STL} \
-DUSE_OPENMP=OFF \
-DENABLE_NEON=ON \
-DENABLE_AVX2=OFF \
-DDEMO=OFF

cmake --build . --config Release -- -j`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`

cmake --build . --config Release --target install/strip -- -j`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`

cd ..

0 comments on commit 5b35c76

Please sign in to comment.