24 lines
660 B
Bash
Executable File
24 lines
660 B
Bash
Executable File
#!/bin/bash
|
|
mkdir -p build && cd $(dirname $0)/build
|
|
|
|
if echo "$@" | grep -iq r; then
|
|
BUILD_TYPE=RELEASE
|
|
else
|
|
BUILD_TYPE=DEBUG
|
|
fi
|
|
|
|
if echo "$@" | grep -iq e; then
|
|
#------ compile for euler -------------------
|
|
TOOLCHAIN=../../toolchains/armv7l_openeuler_setup.cmake
|
|
BUILD_PREFIX=armv7l-openeular
|
|
else
|
|
#------- compile for arm32 ------------------
|
|
TOOLCHAIN=../../toolchains/armv7l_linux_setup.cmake
|
|
BUILD_PREFIX=armv7l-linux
|
|
fi
|
|
|
|
mkdir -p ${BUILD_PREFIX} && cd ${BUILD_PREFIX}
|
|
rm -f CMakeCache.txt
|
|
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN} -DEXECUTABLE_OUTPUT_PATH=../../bin/${BUILD_PREFIX} ../..
|
|
cmake --build . -j 4 --
|