airborne/build.sh

26 lines
579 B
Bash
Raw Normal View History

2023-12-30 22:21:14 +01:00
#!/usr/bin/env bash
CORES=$(nproc)
USED=$(($CORES / 2))
case $(uname -a) in
Linux*)
echo "[+] Using Linux toolchain"
TOOLCHAIN="linux-mingw-w64-x86_64.cmake"
;;
Darwin*)
2024-01-04 19:00:24 +01:00
echo "[+] Using Darwin toolchain"
TOOLCHAIN="darwin-mingw-w64-x86_64.cmake"
2023-12-30 22:21:14 +01:00
;;
esac
2024-01-04 19:00:24 +01:00
echo "[+] Running CMake with specified toolchain, outputting to build/"
if ! cmake -DCMAKE_TOOLCHAIN_FILE=toolchains/$TOOLCHAIN -B build
then
echo "[!] CMake failed, aborting build"
exit 1
fi
2023-12-30 22:21:14 +01:00
2024-01-04 19:00:24 +01:00
echo "[+] Running Make with $USED threads"
2023-12-30 22:21:14 +01:00
make -j$USED -C build