GeezerVison is showing github.com — build: add rust target for macOS cross compiles · nodejs/node@4d8834f
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: configure.py +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1812,6 +1812,10 @@ def configure_node(o): | 1812 | 1812 | if flavor == 'win': | 1813 | 1813 | o['variables']['cargo_rust_target'] = \ | 1814 | 1814 | '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' | 1815 | 1819 |
| 1816 | 1820 | # Allow overriding the compiler - needed by embedders. | 1817 | 1821 | if options.use_clang: | |
Collapse file Copy file name to clipboardExpand all lines: deps/crates/crates.gyp +9-4Lines changed: 9 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 11 | 11 | }, | 12 | 12 | 'conditions': [ | 13 | 13 | ['cargo_rust_target!=""', { | | 14 | + 'variables': { | | 15 | + 'cargo_build_flags': ['--target', '<(cargo_rust_target)'], | | 16 | + } | | 17 | + }], | | 18 | + ['OS=="win"', { | 14 | 19 | 'variables': { | 15 | 20 | 'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/$(Platform)/release/node_crates.lib', | 16 | 21 | }, | 17 | 22 | }, { | 18 | 23 | '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)', | 20 | 25 | }, | 21 | 26 | }], | 22 | 27 | ], | | 25 | 30 | 'cargo_build_flags': [], | 26 | 31 | }, | 27 | 32 | 'conditions': [ | 28 | | - ['cargo_rust_target!=""', { | | 33 | + ['OS=="win"', { | 29 | 34 | 'variables': { | 30 | 35 | 'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/$(Platform)/debug/node_crates.lib', | 31 | 36 | }, | 32 | 37 | }, { | 33 | 38 | '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)', | 35 | 40 | }, | 36 | 41 | }], | 37 | 42 | ], | | 62 | 67 | ], | 63 | 68 | }, | 64 | 69 | 'conditions': [ | 65 | | - ['cargo_rust_target!=""', { | | 70 | + ['OS=="win"', { | 66 | 71 | 'actions': [ | 67 | 72 | { | 68 | 73 | 'action_name': 'cargo_build', | |
|