2020-09-25 16:43:53 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-09-17 02:00:40 +00:00
|
|
|
# Build
|
|
|
|
build() {
|
2022-03-06 20:53:27 +00:00
|
|
|
# Use Build Dir
|
2022-06-25 21:30:08 +00:00
|
|
|
if [ ! -f "build/${MODE}-${ARCH}/arm/build.ninja" ] || [ ! -f "build/${MODE}-${ARCH}/native/build.ninja" ]; then
|
2022-03-06 20:53:27 +00:00
|
|
|
./scripts/setup.sh "${MODE}" "${ARCH}"
|
2021-06-17 21:32:24 +00:00
|
|
|
fi
|
2022-03-06 20:53:27 +00:00
|
|
|
cd "build/${MODE}-${ARCH}"
|
2021-06-24 16:40:34 +00:00
|
|
|
|
|
|
|
# Create Prefix
|
2022-03-06 20:53:27 +00:00
|
|
|
local prefix="$(cd ../../; pwd)/out/${MODE}-${ARCH}"
|
2021-06-24 16:40:34 +00:00
|
|
|
rm -rf "${prefix}"
|
|
|
|
mkdir -p "${prefix}"
|
|
|
|
|
|
|
|
# Build ARM Components
|
|
|
|
cd arm
|
2022-03-07 01:13:41 +00:00
|
|
|
cmake --build .
|
|
|
|
DESTDIR="${prefix}" cmake --install .
|
2021-06-24 16:40:34 +00:00
|
|
|
cd ../
|
|
|
|
|
|
|
|
# Build Native Components
|
|
|
|
cd native
|
2022-03-07 01:13:41 +00:00
|
|
|
cmake --build .
|
|
|
|
DESTDIR="${prefix}" cmake --install .
|
2021-06-24 16:40:34 +00:00
|
|
|
cd ../
|
|
|
|
|
|
|
|
# Exit
|
|
|
|
cd ../../
|
|
|
|
}
|
|
|
|
|
2022-03-06 20:53:27 +00:00
|
|
|
# Variables
|
|
|
|
MODE="$1"
|
|
|
|
ARCH="$2"
|
|
|
|
shift 2
|
2021-09-16 20:39:24 +00:00
|
|
|
|
2021-06-17 21:32:24 +00:00
|
|
|
# Build
|
2022-07-02 22:14:23 +00:00
|
|
|
build "${MODE}" "${ARCH}"
|