Skip to content

Commit ff3dccc

Browse files
committed
build: add rust target for macOS cross compiles
When we build the macOS pkg, we build Node.js twice (on arm64): - Once for arm64 (native) - Once for x64, using a combination of Rosetta 2 and compiler flags before combining both into a universal binary. For the x64 case, pass target flag to `rustc` so that the binary is built for the correct target architecture. Signed-off-by: Richard Lau <[email protected]>
1 parent 186995e commit ff3dccc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,8 @@ endif
11821182
--tag=$(TAG) \
11831183
--release-urlbase=$(RELEASE_URLBASE) \
11841184
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
1185-
arch -x86_64 $(MAKE) install V=$(V) DESTDIR=$(MACOSOUTDIR)/dist/x64/node
1185+
CARGO_BUILD_TARGET="x86_64-apple-darwin" \
1186+
arch -x86_64 $(MAKE) install V=$(V) DESTDIR=$(MACOSOUTDIR)/dist/x64/node
11861187
SIGN="$(CODESIGN_CERT)" PKGDIR="$(MACOSOUTDIR)/dist/x64/node/usr/local" sh \
11871188
tools/osx-codesign.sh
11881189
$(PYTHON) ./configure \

0 commit comments

Comments
 (0)