Skip to content

Commit 507b857

Browse files
author
Zach Banks
committed
BLD: Add proc limit to databento-cpp build
1 parent 040fff2 commit 507b857

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/build.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
#! /usr/bin/env bash
2-
set -e
2+
set -euo pipefail
3+
set -x
4+
5+
# Control the parallelism with the `NPROC` env
6+
# If unset, it defaults to the smaller of `nproc` or 8
7+
if [ -z "${NPROC+x}" ]; then
8+
NPROC="$(nproc)"
9+
NPROC="$(( $NPROC > 8 ? 8 : $NPROC ))"
10+
fi
311

412
cmake -S . -B build \
513
-DDATABENTO_ENABLE_UNIT_TESTING=1 \
614
-DDATABENTO_ENABLE_EXAMPLES=1 \
715
-DDATABENTO_ENABLE_CLANG_TIDY=1 \
816
-DDATABENTO_ENABLE_ASAN=1 \
917
-DDATABENTO_ENABLE_UBSAN=1
10-
cmake --build build -- -j "$(nproc)"
18+
cmake --build build -- -j "$NPROC"

0 commit comments

Comments
 (0)