From 52587d8880037b85081bacc9c48bc559f841425c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 7 Dec 2023 09:13:21 +0100 Subject: [PATCH] Detect JOBS in a more portable way --- .github/workflows/ci.yml | 10 ++++------ Makefile | 11 ++++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bad58e52..d63a69f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/Makefile b/Makefile index 92192e51..c9d24b66 100644 --- a/Makefile +++ b/Makefile @@ -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