2020-09-25 12:43:53 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-03-06 15:53:27 -05:00
|
|
|
# Variables
|
2023-11-24 18:37:08 -05:00
|
|
|
MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
|
|
|
|
ARCH="$(echo "$2" | tr '[:upper:]' '[:lower:]')"
|
2021-09-16 16:39:24 -04:00
|
|
|
|
2023-12-26 17:45:53 -05:00
|
|
|
# Run CMake If Needed
|
2024-01-16 01:45:52 -05:00
|
|
|
if [ ! -f "build/${MODE}-${ARCH}/build.ninja" ]; then
|
2023-12-26 17:45:53 -05:00
|
|
|
./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
|
|
|
|
|
2024-01-16 01:45:52 -05:00
|
|
|
# Build
|
2023-12-26 17:45:53 -05:00
|
|
|
cmake --build .
|
|
|
|
cmake --install .
|
|
|
|
|
|
|
|
# Exit
|
|
|
|
cd ../../
|