Skip to content

Commit 5585626

Browse files
committed
Detect JOBS in a more portable way
1 parent ffa73c8 commit 5585626

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.github/workflows/ci.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,10 @@ jobs:
385385
with:
386386
usesh: true
387387
prepare: |
388-
pkg_add cmake
388+
pkg_add cmake gmake
389389
run: |
390-
cmake -B build
391-
cmake --build build -j $(sysctl -n hw.ncpu)
392-
./build/qjs -qd
390+
gmake
391+
gmake stats
393392
394393
freebsd:
395394
runs-on: ubuntu-latest
@@ -400,8 +399,7 @@ jobs:
400399
with:
401400
usesh: true
402401
prepare: |
403-
pkg install -y cmake
402+
pkg install -y cmake gmake
404403
run: |
405-
cmake -B build
406-
cmake --build build -j $(sysctl -n hw.ncpu)
407-
./build/qjs -qd
404+
gmake
405+
gmake stats

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,20 @@
2626

2727
BUILD_DIR=build
2828
BUILD_TYPE?=Release
29-
JOBS?=$(shell getconf _NPROCESSORS_ONLN)
3029

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

33+
JOBS?=$(shell getconf _NPROCESSORS_ONLN)
34+
ifeq ($(JOBS),)
35+
JOBS := $(shell sysctl -n hw.ncpu)
36+
endif
37+
ifeq ($(JOBS),)
38+
JOBS := $(shell nproc)
39+
endif
40+
ifeq ($(JOBS),)
41+
JOBS := 4
42+
endif
3443

3544
all: $(QJS)
3645

0 commit comments

Comments
 (0)