Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use BUILDTYPE in bench-addons-build targets #24033

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ test-valgrind: all
test-check-deopts: all
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --check-deopts parallel sequential

benchmark/napi/function_call/build/Release/binding.node: \
benchmark/napi/function_call/build/$(BUILDTYPE)/binding.node: \
benchmark/napi/function_call/napi_binding.c \
benchmark/napi/function_call/binding.cc \
benchmark/napi/function_call/binding.gyp | all
Expand All @@ -317,7 +317,7 @@ benchmark/napi/function_call/build/Release/binding.node: \
--directory="$(shell pwd)/benchmark/napi/function_call" \
--nodedir="$(shell pwd)"

benchmark/napi/function_args/build/Release/binding.node: \
benchmark/napi/function_args/build/$(BUILDTYPE)/binding.node: \
benchmark/napi/function_args/napi_binding.c \
benchmark/napi/function_args/binding.cc \
benchmark/napi/function_args/binding.gyp | all
Expand Down Expand Up @@ -1044,8 +1044,8 @@ bench: bench-addons-build

# Build required addons for benchmark before running it.
.PHONY: bench-addons-build
bench-addons-build: benchmark/napi/function_call/build/Release/binding.node \
benchmark/napi/function_args/build/Release/binding.node
bench-addons-build: benchmark/napi/function_call/build/$(BUILDTYPE)/binding.node \
benchmark/napi/function_args/build/$(BUILDTYPE)/binding.node

.PHONY: bench-addons-clean
bench-addons-clean:
Expand Down
2 changes: 2 additions & 0 deletions benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
const child_process = require('child_process');
const http_benchmarkers = require('./_http-benchmarkers.js');

exports.buildType = process.features.debug ? 'Debug' : 'Release';

exports.createBenchmark = function(fn, configs, options) {
return new Benchmark(fn, configs, options);
};
Expand Down
4 changes: 2 additions & 2 deletions benchmark/napi/function_args/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ let v8;
let napi;

try {
v8 = require('./build/Release/binding');
v8 = require(`./build/${common.buildType}/binding`);
danbev marked this conversation as resolved.
Show resolved Hide resolved
} catch {
console.error(`${__filename}: V8 Binding failed to load`);
process.exit(0);
}

try {
napi = require('./build/Release/napi_binding');
napi = require(`./build/${common.buildType}/napi_binding`);
} catch {
console.error(`${__filename}: NAPI-Binding failed to load`);
process.exit(0);
Expand Down
4 changes: 2 additions & 2 deletions benchmark/napi/function_call/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const common = require('../../common.js');
// abort quietly.

try {
var binding = require('./build/Release/binding');
var binding = require(`./build/${common.buildType}/binding`);
} catch {
console.error('misc/function_call.js Binding failed to load');
process.exit(0);
Expand All @@ -21,7 +21,7 @@ const cxx = binding.hello;

let napi_binding;
try {
napi_binding = require('./build/Release/napi_binding');
napi_binding = require(`./build/${common.buildType}/napi_binding`);
} catch {
console.error('misc/function_call/index.js NAPI-Binding failed to load');
process.exit(0);
Expand Down