Detect JOBS in a more portable way
This commit is contained in:
parent
ffa73c8f18
commit
622ce2cc9d
2 changed files with 16 additions and 9 deletions
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
|
@ -385,11 +385,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
usesh: true
|
usesh: true
|
||||||
prepare: |
|
prepare: |
|
||||||
pkg_add cmake
|
pkg_add cmake gmake
|
||||||
run: |
|
run: |
|
||||||
cmake -B build
|
gmake
|
||||||
cmake --build build -j $(sysctl -n hw.ncpu)
|
gmake stats
|
||||||
./build/qjs -qd
|
|
||||||
|
|
||||||
freebsd:
|
freebsd:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -400,8 +399,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
usesh: true
|
usesh: true
|
||||||
prepare: |
|
prepare: |
|
||||||
pkg install -y cmake
|
pkg install -y cmake gmake
|
||||||
run: |
|
run: |
|
||||||
cmake -B build
|
gmake
|
||||||
cmake --build build -j $(sysctl -n hw.ncpu)
|
gmake stats
|
||||||
./build/qjs -qd
|
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -26,11 +26,20 @@
|
||||||
|
|
||||||
BUILD_DIR=build
|
BUILD_DIR=build
|
||||||
BUILD_TYPE?=Release
|
BUILD_TYPE?=Release
|
||||||
JOBS?=$(shell getconf _NPROCESSORS_ONLN)
|
|
||||||
|
|
||||||
QJS=$(BUILD_DIR)/qjs
|
QJS=$(BUILD_DIR)/qjs
|
||||||
RUN262=$(BUILD_DIR)/run-test262
|
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: $(QJS)
|
all: $(QJS)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue