Skip to content

Commit 86e2a76

Browse files
legendecasaduh95
authored andcommitted
build: infer cargo mode with gyp var build_type directly
PR-URL: #61354 Refs: https://github.com/nodejs/gyp-next/blob/main/docs/InputFormatReference.md#processing-order Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 3bb4815 commit 86e2a76

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

configure.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,11 +1864,6 @@ def configure_library(lib, output, pkgname=None):
18641864
output['libraries'] += pkg_libs.split()
18651865

18661866

1867-
def configure_rust(o, configs):
1868-
set_configuration_variable(configs, 'cargo_build_mode', release='release', debug='debug')
1869-
set_configuration_variable(configs, 'cargo_build_flags', release=['--release'], debug=[])
1870-
1871-
18721867
def configure_v8(o, configs):
18731868
set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0)
18741869

@@ -2467,7 +2462,6 @@ def make_bin_override():
24672462
configure_static(output)
24682463
configure_inspector(output)
24692464
configure_section_file(output)
2470-
configure_rust(output, configurations)
24712465

24722466
# remove builtins that have been disabled
24732467
if options.without_amaro:

deps/crates/crates.gyp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
{
22
'variables': {
33
'cargo_vendor_dir': './vendor',
4-
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/>(cargo_build_mode)/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
54
},
5+
'conditions': [
6+
['build_type == "Release"', {
7+
'variables': {
8+
'cargo_build_flags': ['--release'],
9+
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/release/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
10+
},
11+
}, {
12+
'variables': {
13+
'cargo_build_flags': [],
14+
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/debug/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
15+
},
16+
}]
17+
],
618
'targets': [
719
{
820
'target_name': 'node_crates',
@@ -38,7 +50,7 @@
3850
'action': [
3951
'cargo',
4052
'rustc',
41-
'>@(cargo_build_flags)',
53+
'<@(cargo_build_flags)',
4254
'--frozen',
4355
'--target-dir',
4456
'<(SHARED_INTERMEDIATE_DIR)'

0 commit comments

Comments
 (0)