Skip to content

Commit

Permalink
Detect JOBS in a more portable way
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Dec 7, 2023
1 parent e7e938f commit 52587d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,8 @@ jobs:
prepare: |
pkg_add cmake
run: |
cmake -B build
cmake --build build -j $(sysctl -n hw.ncpu)
./build/qjs -qd
make
make stats
freebsd:
runs-on: ubuntu-latest
Expand All @@ -413,6 +412,5 @@ jobs:
prepare: |
pkg install -y cmake
run: |
cmake -B build
cmake --build build -j $(sysctl -n hw.ncpu)
./build/qjs -qd
make
make stats
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,20 @@

BUILD_DIR=build
BUILD_TYPE?=Release
JOBS?=$(shell getconf _NPROCESSORS_ONLN)

QJS=$(BUILD_DIR)/qjs
RUN262=$(BUILD_DIR)/run-test262

JOBS?=$(shell getconf _NPROCESSORS_ONLN)
ifeq ($(JOBS),)
JOBS := $(shell sysctl -n hw.ncpu)
endif
ifeq ($(JOBS),)
JOBS := $(shell nproc)
endif
ifeq ($(JOBS),)
JOBS := 4
endif

all: build

Expand Down

0 comments on commit 52587d8

Please sign in to comment.