2020-03-30 16:16:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-04-02 20:53:48 +00:00
|
|
|
cd "$(dirname "$0")" || { echo "Failed to enter base dir"; exit 1; }
|
2020-03-30 16:16:03 +00:00
|
|
|
[[ -d build_ ]] && {
|
|
|
|
rm -r build_ || { echo "failed to remove old build directory"; exit 1; }
|
|
|
|
}
|
2020-06-10 16:48:48 +00:00
|
|
|
|
2020-03-30 16:16:03 +00:00
|
|
|
mkdir build_ || exit 1
|
|
|
|
cd build_ || exit 1
|
|
|
|
|
|
|
|
emcmake cmake .. || {
|
2020-06-10 16:48:48 +00:00
|
|
|
echo "emcmake cmake failed for the first time, trying it again" #IDKW but sometimes it does not work the first try
|
2020-08-05 16:25:08 +00:00
|
|
|
cd . # Sometimes helps
|
2020-06-10 16:48:48 +00:00
|
|
|
emcmake cmake .. || {
|
|
|
|
echo "Failed to execute cmake"
|
|
|
|
exit 1
|
|
|
|
}
|
2020-03-30 16:16:03 +00:00
|
|
|
}
|
|
|
|
|
2020-03-31 00:14:48 +00:00
|
|
|
emmake make -j"$(nproc --all)" || {
|
2020-06-10 16:48:48 +00:00
|
|
|
echo "Failed to build file"
|
|
|
|
exit 1
|
2020-03-30 16:16:03 +00:00
|
|
|
}
|