◐ Shell
clean mode source ↗

build: build addon tests in parallel · nodejs/node@896017b

@@ -315,25 +315,14 @@ ADDONS_BINDING_SOURCES := \

315315

# Depends on node-gyp package.json so that build-addons is (re)executed when

316316

# node-gyp is updated as part of an npm update.

317317

test/addons/.buildstamp: config.gypi \

318-

deps/npm/node_modules/node-gyp/package.json \

318+

deps/npm/node_modules/node-gyp/package.json tools/build-addons.js \

319319

$(ADDONS_BINDING_GYPS) $(ADDONS_BINDING_SOURCES) \

320320

deps/uv/include/*.h deps/v8/include/*.h \

321321

src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \

322322

test/addons/.docbuildstamp

323-

# Cannot use $(wildcard test/addons/*/) here, it's evaluated before

324-

# embedded addons have been generated from the documentation.

325-

# Ignore folders without binding.gyp

326-

# (https://github.com/nodejs/node/issues/14843)

327-

@for dirname in test/addons/*/; do \

328-

if [ ! -f "$$PWD/$${dirname}binding.gyp" ]; then \

329-

continue; fi ; \

330-

printf "\nBuilding addon $$PWD/$$dirname\n" ; \

331-

env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \

332-

--loglevel=$(LOGLEVEL) rebuild \

333-

--python="$(PYTHON)" \

334-

--directory="$$PWD/$$dirname" \

335-

--nodedir="$$PWD" || exit 1 ; \

336-

done

323+

env npm_config_loglevel=$(LOGLEVEL) npm_config_nodedir="$$PWD" \

324+

npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons" \

325+

"$$PWD/deps/npm/node_modules/node-gyp/bin/node-gyp.js" "$$PWD/test/addons"

337326

touch $@

338327339328

.PHONY: build-addons

@@ -355,25 +344,15 @@ ADDONS_NAPI_BINDING_SOURCES := \

355344356345

# Implicitly depends on $(NODE_EXE), see the build-addons-napi rule for rationale.

357346

test/addons-napi/.buildstamp: config.gypi \

358-

deps/npm/node_modules/node-gyp/package.json \

347+

deps/npm/node_modules/node-gyp/package.json tools/build-addons.js \

359348

$(ADDONS_NAPI_BINDING_GYPS) $(ADDONS_NAPI_BINDING_SOURCES) \

360349

deps/uv/include/*.h deps/v8/include/*.h \

361350

src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \

362351

src/node_api.h src/node_api_types.h

363-

# Cannot use $(wildcard test/addons-napi/*/) here, it's evaluated before

364-

# embedded addons have been generated from the documentation.

365-

# Ignore folders without binding.gyp

366-

# (https://github.com/nodejs/node/issues/14843)

367-

@for dirname in test/addons-napi/*/; do \

368-

if [ ! -f "$$PWD/$${dirname}binding.gyp" ]; then \

369-

continue; fi ; \

370-

printf "\nBuilding addon $$PWD/$$dirname\n" ; \

371-

env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \

372-

--loglevel=$(LOGLEVEL) rebuild \

373-

--python="$(PYTHON)" \

374-

--directory="$$PWD/$$dirname" \

375-

--nodedir="$$PWD" || exit 1 ; \

376-

done

352+

env npm_config_loglevel=$(LOGLEVEL) npm_config_nodedir="$$PWD" \

353+

npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons" \

354+

"$$PWD/deps/npm/node_modules/node-gyp/bin/node-gyp.js" \

355+

"$$PWD/test/addons-napi"

377356

touch $@

378357379358

.PHONY: build-addons-napi