2020-09-25 16:43:53 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-03-06 20:53:27 +00:00
|
|
|
# Variables
|
2023-11-24 23:37:08 +00:00
|
|
|
MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
|
|
|
|
ARCH="$(echo "$2" | tr '[:upper:]' '[:lower:]')"
|
2021-09-16 20:39:24 +00:00
|
|
|
|
2023-12-26 22:45:53 +00:00
|
|
|
# Run CMake If Needed
|
|
|
|
if [ ! -f "build/${MODE}-${ARCH}/arm/build.ninja" ] || [ ! -f "build/${MODE}-${ARCH}/native/build.ninja" ]; then
|
|
|
|
./scripts/setup.sh "${MODE}" "${ARCH}"
|
|
|
|
fi
|
|
|
|
# Use Build Dir
|
|
|
|
cd "build/${MODE}-${ARCH}"
|
|
|
|
|
|
|
|
# Create Prefix
|
|
|
|
if [ -z "${DESTDIR+x}" ]; then
|
|
|
|
export DESTDIR="$(cd ../../; pwd)/out/${MODE}-${ARCH}"
|
|
|
|
rm -rf "${DESTDIR}"
|
|
|
|
mkdir -p "${DESTDIR}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Build ARM Components
|
|
|
|
cd arm
|
|
|
|
cmake --build .
|
|
|
|
cmake --install .
|
|
|
|
cd ../
|
|
|
|
|
|
|
|
# Build Native Components
|
|
|
|
cd native
|
|
|
|
cmake --build .
|
|
|
|
cmake --install .
|
|
|
|
cd ../
|
|
|
|
|
|
|
|
# Exit
|
|
|
|
cd ../../
|