mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
Add cargo config to support building a unified cargo static lib to include multiple crate dependencies to be used by Node.js. This also allows additional crate dependencies to be added, like amaro. PR-URL: https://github.com/nodejs/node/pull/61072 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
55 lines
1.2 KiB
Python
55 lines
1.2 KiB
Python
{
|
|
'variables': {
|
|
'cargo_vendor_dir': './vendor',
|
|
},
|
|
'targets': [
|
|
{
|
|
'target_name': 'node_crates',
|
|
'type': 'none',
|
|
'hard_dependency': 1,
|
|
'sources': [
|
|
'Cargo.toml',
|
|
'Cargo.lock',
|
|
'src/lib.rs',
|
|
],
|
|
'link_settings': {
|
|
'libraries': [
|
|
'<(SHARED_INTERMEDIATE_DIR)/>(cargo_build_mode)/libnode_crates.a',
|
|
],
|
|
},
|
|
'actions': [
|
|
{
|
|
'action_name': 'cargo_build',
|
|
'inputs': [
|
|
'<@(_sources)'
|
|
],
|
|
'outputs': [
|
|
'<(SHARED_INTERMEDIATE_DIR)/>(cargo_build_mode)/libnode_crates.a'
|
|
],
|
|
'action': [
|
|
'cargo',
|
|
'rustc',
|
|
'>@(cargo_build_flags)',
|
|
'--frozen',
|
|
'--target-dir',
|
|
'<(SHARED_INTERMEDIATE_DIR)'
|
|
],
|
|
}
|
|
],
|
|
},
|
|
{
|
|
'target_name': 'temporal_capi',
|
|
'type': 'none',
|
|
'sources': [],
|
|
'dependencies': [
|
|
'node_crates',
|
|
],
|
|
'direct_dependent_settings': {
|
|
'include_dirs': [
|
|
'<(cargo_vendor_dir)/temporal_capi/bindings/cpp',
|
|
],
|
|
},
|
|
},
|
|
]
|
|
}
|