nut-tree/libnut-core

Apple Silicon

Closed this issue · 3 comments

Version
2.1
Short overview
Release fat binaries for macOS to work on Apple Silicon

Steps to reproduce error
M1 Macs fail at running the built version.

Fix
Build using both archs:

cmake-js rebuild --CDNODE_ARCH="arm64;x86_64" --CDCMAKE_OSX_ARCHITECTURES="arm64;x86_64"

And it'll result in both binaries being included:

lipo -info build/Release/libnut.node
# Architectures in the fat file: build/Release/libnut.node are: x86_64 arm64

Hi @momakes2 👋

Thanks for pointing this out. As I do not have access to M1 hardware I’m unable to test on it.

Would you be interested in opening a PR which incorporates your suggested flags into CMakeLists.txt?

@s1hofmann Sure! But I have no background using CMake (or C) so I please hint me on the CMake Lists and I'll make a PR.
Then should I only test the yarn build:release command? I tried it last night and It worked using this flag.

Will open a PR.

Done. I have an M1 Macbook, so feel free to ping me for testing stuff.