fix compatibility with macOS in compile.sh

This commit is contained in:
PoroCYon
2025-12-10 15:24:39 +01:00
parent 8e5e43f44e
commit a7e49ca017
2 changed files with 11 additions and 2 deletions

3
.gitignore vendored
View File

@@ -3,6 +3,7 @@
Debug/
Release/
build/
cmake-build*/
out/
# Compiled source #
@@ -48,4 +49,4 @@ Thumbs.db
*.a
.vscode/
roms/*.nds
data/uartBufv060.bin
data/uartBufv060.bin

View File

@@ -11,6 +11,14 @@
set -euo pipefail
if command -v nproc >/dev/null 2>&1; then
NPROC="$(nproc)"
else
# macOS doesn't have nproc(1). using getconf here is also more general than
# using sysctl
NPROC="$(getconf _NPROCESSORS_ONLN)"
fi
# change directory to the one containing the source code project
cd "$(dirname "$(realpath "$0")")"
@@ -35,7 +43,7 @@ echo "[>] Building FIRMWARE: "
# Go and build the firmware
PICO_SDK_PATH=../pico-sdk \
CMAKE_POLICY_VERSION_MINIMUM=3.5 \
CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)" \
CMAKE_BUILD_PARALLEL_LEVEL="${NPROC}" \
cmake --build build
echo "[>] Build completed. Find the DSpico.uf2 file inside build/ folder"