Skip to content

Commit

Permalink
build(builder): added parallel compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
ms0g committed Apr 19, 2024
1 parent 7e0ee50 commit cc31750
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build/builder.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
#!/bin/bash
cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build .

OS="$(uname -s)"
if [ "$OS" = "Linux" ]; then
NPROCS="$(nproc --all)"
elif [ "$OS" = "Darwin" ] || [ "$(echo "$OS" | grep -q BSD)" = "BSD" ]; then
NPROCS="$(sysctl -n hw.ncpu)"
else
NPROCS="$(getconf _NPROCESSORS_ONLN)"
fi

cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build . --parallel "$NPROCS"

0 comments on commit cc31750

Please sign in to comment.