Skip to content

Commit

Permalink
fix: aarch64-apple-darwin (macOS m1 chips) build [skip skia]
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Sep 24, 2021
1 parent adfe755 commit 4deee73
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ jobs:
- host: macos-latest
downloadTarget: 'aarch64-apple-darwin'
target: 'aarch64-apple-darwin'
build: pnpm build -- --target=aarch64-apple-darwin
build: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
pnpm build -- --target=aarch64-apple-darwin
- host: ubuntu-18.04
downloadTarget: 'aarch64-unknown-linux-gnu'
target: 'aarch64-unknown-linux-gnu'
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn main() {
));
}
"aarch64-apple-darwin" => {
build.target("arm64-apple-darwin");
build.target("arm64-apple-macos");
}
"aarch64-linux-android" => {
let nkd_home = env::var("ANDROID_NDK_HOME").unwrap();
Expand Down
8 changes: 4 additions & 4 deletions scripts/build-skia.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ switch (TARGET_TRIPLE) {
break
case 'aarch64-apple-darwin':
ExtraSkiaBuildFlag += ' target_cpu="arm64" target_os="mac"'
ExtraCflagsCC += ', "--target=arm64-apple-darwin"'
ExtraLdFlags = '"--target=arm64-apple-darwin"'
ExtraAsmFlags = '"--target=arm64-apple-darwin"'
ExtraCflags = '"--target=arm64-apple-darwin"'
ExtraCflagsCC += ', "--target=arm64-apple-macos"'
ExtraLdFlags = '"--target=arm64-apple-macos"'
ExtraAsmFlags = '"--target=arm64-apple-macos"'
ExtraCflags = '"--target=arm64-apple-macos"'
GN_ARGS.push(
`extra_ldflags=[${ExtraLdFlags}]`,
`extra_asmflags=[${ExtraAsmFlags}]`,
Expand Down
2 changes: 1 addition & 1 deletion skia

1 comment on commit 4deee73

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 4deee73 Previous: 3fe6772 Ratio
Draw house#skia-canvas 22 ops/sec (±0.27%) 23 ops/sec (±0.46%) 1.05
Draw house#node-canvas 19 ops/sec (±0.6%) 20 ops/sec (±0.42%) 1.05
Draw house#@napi-rs/skia 21 ops/sec (±0.66%) 21 ops/sec (±0.38%) 1
Draw gradient#skia-canvas 21 ops/sec (±0.62%) 22 ops/sec (±0.54%) 1.05
Draw gradient#node-canvas 19 ops/sec (±0.22%) 19 ops/sec (±0.34%) 1
Draw gradient#@napi-rs/skia 20 ops/sec (±0.13%) 20 ops/sec (±0.5%) 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.