extern_interface/mak

27 lines
781 B
Plaintext
Raw Normal View History

2024-11-28 08:31:00 +00:00
#!/bin/bash
set -e
BASEDIR=$(cd "$(dirname "$0")"; pwd)
mkdir -p ${BASEDIR}/build && cd ${BASEDIR}/build
2024-11-28 08:31:00 +00:00
if echo "$@" | grep -iq r; then
BUILD_TYPE=RELEASE
else
BUILD_TYPE=DEBUG
fi
if echo "$@" | grep -iq e; then
#------ compile for euler -------------------
TOOLCHAIN=${BASEDIR}/toolchains/armv7l_openeuler_setup.cmake
2024-11-28 08:31:00 +00:00
BUILD_PREFIX=armv7l-openeular
else
#------- compile for arm32 ------------------
TOOLCHAIN=${BASEDIR}/toolchains/armv7l_linux_setup.cmake
2024-11-28 08:31:00 +00:00
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=${BASEDIR}/bin/${BUILD_PREFIX} -DLIBRARY_OUTPUT_PATH=${BASEDIR}/lib/${BUILD_PREFIX} ../..
cmake --build . -j 6 --