2020-08-05 03:53:02 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-11-23 00:51:45 +02:00
|
|
|
# SET BUILD OPTIONS
|
|
|
|
ASM_OPTIONS=""
|
2020-08-05 03:53:02 +03:00
|
|
|
case ${ARCH} in
|
2020-11-23 00:51:45 +02:00
|
|
|
arm-v7a | arm-v7a-neon | arm64-v8a)
|
|
|
|
ASM_OPTIONS="-DSSE2_FOUND=0 -DSSE3_FOUND=0 -DSSSE3_FOUND=0 -DSSE4_1_FOUND=0"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
ASM_OPTIONS=""
|
|
|
|
;;
|
2020-08-05 03:53:02 +03:00
|
|
|
esac
|
|
|
|
|
2020-11-23 00:51:45 +02:00
|
|
|
mkdir -p "${BUILD_DIR}" || return 1
|
|
|
|
cd "${BUILD_DIR}" || return 1
|
2020-08-05 03:53:02 +03:00
|
|
|
|
2021-09-18 15:20:11 +03:00
|
|
|
# WORKAROUND TO DETECT ASM FLAGS PROPERLY
|
|
|
|
${SED_INLINE} 's/ ${CPUINFO}/ "${CPUINFO}"/g' "${BASEDIR}"/src/"${LIB_NAME}"/CMakeModules/FindSSE.cmake 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
|
|
|
|
|
2020-11-23 00:51:45 +02:00
|
|
|
cmake -Wno-dev \
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=0 \
|
|
|
|
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
|
|
|
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
|
|
|
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
|
|
|
|
-DCMAKE_SYSROOT="${ANDROID_SYSROOT}" \
|
|
|
|
-DCMAKE_FIND_ROOT_PATH="${ANDROID_SYSROOT}" \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="${LIB_INSTALL_PREFIX}" \
|
|
|
|
-DCMAKE_SYSTEM_NAME=Generic \
|
|
|
|
-DCMAKE_C_COMPILER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$CC" \
|
|
|
|
-DCMAKE_LINKER="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$LD" \
|
|
|
|
-DCMAKE_AR="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AR" \
|
|
|
|
-DCMAKE_AS="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/$AS" \
|
|
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
|
|
|
|
-DUSE_OMP=0 \
|
|
|
|
${ASM_OPTIONS} \
|
|
|
|
-DCMAKE_SYSTEM_PROCESSOR=$(get_cmake_system_processor) \
|
|
|
|
-DBUILD_SHARED_LIBS=0 "${BASEDIR}"/src/"${LIB_NAME}" || return 1
|
|
|
|
|
|
|
|
make -j$(get_cpu_count) || return 1
|
|
|
|
|
|
|
|
make install || return 1
|
2020-08-05 03:53:02 +03:00
|
|
|
|
|
|
|
# MANUALLY COPY PKG-CONFIG FILES
|
2020-11-23 00:51:45 +02:00
|
|
|
cp vidstab.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
|