fix: build universal binary (arm64/apple silicon)

This commit is contained in:
Andrei Alecu
2020-12-31 14:27:15 +02:00
parent de08c593bb
commit dfbce19167
2 changed files with 13 additions and 2 deletions
+6 -1
View File
@@ -2,7 +2,7 @@ name: Node CI
on: [push, pull_request]
jobs:
build:
runs-on: macOS-latest
runs-on: macOS-11.0
strategy:
matrix:
node-version: [8, 10, 12, 14, 15]
@@ -18,5 +18,10 @@ jobs:
npm install
npm run build --if-present
npm test
- name: ensure universal binary (arm64/x86_64)
run: |
file fsevents.node
file fsevents.node | grep -q arm64 || (echo "arm64 binary not built"; exit 1)
file fsevents.node | grep -q x86_64 || (echo "x86_64 binary not built"; exit 1)
env:
CI: true
+7 -1
View File
@@ -5,9 +5,15 @@
"target_name": "fsevents",
"sources": [ "src/fsevents.c"],
"xcode_settings": {
"OTHER_CFLAGS": [
"-arch x86_64",
"-arch arm64"
],
"OTHER_LDFLAGS": [
"-Wl,-bind_at_load",
"-framework CoreFoundation -framework CoreServices"
"-framework CoreFoundation -framework CoreServices",
"-arch x86_64",
"-arch arm64"
]
}
}, {