GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — build: add rust target for macOS cross compiles · nodejs/node@4d8834f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • configure.py
  • deps/crates
    • crates.gyp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎configure.py‎

Copy file name to clipboardExpand all lines: configure.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,6 +1812,10 @@ def configure_node(o):
18121812
if flavor == 'win':
18131813
o['variables']['cargo_rust_target'] = \
18141814
'aarch64-pc-windows-msvc' if target_arch == 'arm64' else 'x86_64-pc-windows-msvc'
1815+
# Always set the Rust target for x64 macOS in case we will be building
1816+
# under Rosetta 2.
1817+
if flavor == 'mac' and target_arch == 'x64':
1818+
o['variables']['cargo_rust_target'] = 'x86_64-apple-darwin'
18151819

18161820
# Allow overriding the compiler - needed by embedders.
18171821
if options.use_clang:
Collapse file

‎deps/crates/crates.gyp‎

Copy file name to clipboardExpand all lines: deps/crates/crates.gyp
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@
1111
},
1212
'conditions': [
1313
['cargo_rust_target!=""', {
14+
'variables': {
15+
'cargo_build_flags': ['--target', '<(cargo_rust_target)'],
16+
}
17+
}],
18+
['OS=="win"', {
1419
'variables': {
1520
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/$(Platform)/release/node_crates.lib',
1621
},
1722
}, {
1823
'variables': {
19-
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/release/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
24+
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/<(cargo_rust_target)/release/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
2025
},
2126
}],
2227
],
@@ -25,13 +30,13 @@
2530
'cargo_build_flags': [],
2631
},
2732
'conditions': [
28-
['cargo_rust_target!=""', {
33+
['OS=="win"', {
2934
'variables': {
3035
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/$(Platform)/debug/node_crates.lib',
3136
},
3237
}, {
3338
'variables': {
34-
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/debug/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
39+
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/<(cargo_rust_target)/debug/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
3540
},
3641
}],
3742
],
@@ -62,7 +67,7 @@
6267
],
6368
},
6469
'conditions': [
65-
['cargo_rust_target!=""', {
70+
['OS=="win"', {
6671
'actions': [
6772
{
6873
'action_name': 'cargo_build',

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.