Skip to content

Commit 161a312

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 161a312

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,7 @@ endif
11751175
| sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \
11761176
>$(MACOSOUTDIR)/installer/productbuild/Resources/$$lang/conclusion.html ; \
11771177
done
1178+
RUSTC="rustc --target x86_64-apple-darwin" \
11781179
CC_host="cc -arch x86_64" CXX_host="c++ -arch x86_64" \
11791180
CC_target="cc -arch x86_64" CXX_target="c++ -arch x86_64" \
11801181
CC="cc -arch x86_64" CXX="c++ -arch x86_64" $(PYTHON) ./configure \

0 commit comments

Comments
 (0)