Skip to content

Commit

Permalink
fix: build macos with xcode llvm (#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian authored Oct 24, 2024
1 parent 069d27c commit b099c0a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ jobs:
settings:
- host: macos-latest
target: 'x86_64-apple-darwin'
setup: brew install nasm llvm
setup: brew install nasm
build: |
rustc --print target-cpus
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
yarn build --target x86_64-apple-darwin
downloadTarget: ''
Expand Down Expand Up @@ -100,11 +99,8 @@ jobs:
- host: macos-latest
downloadTarget: 'aarch64-apple-darwin'
target: 'aarch64-apple-darwin'
setup: |
brew install llvm
build: |
export MACOSX_DEPLOYMENT_TARGET='11.0'
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
yarn build --target aarch64-apple-darwin
- host: ubuntu-latest
Expand Down Expand Up @@ -606,7 +602,6 @@ jobs:

- name: Test
run: |
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
cargo test -- --nocapture
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/skia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
shell: bash

- name: Install tools on macOS
run: brew install ninja llvm
run: brew install ninja
if: matrix.os == 'macos-latest'

- name: Install tools on Windows
Expand Down Expand Up @@ -83,7 +83,6 @@ jobs:
env:
PYTHONHTTPSVERIFY: 0
run: |
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
node ./scripts/build-skia.js --target=x86_64-apple-darwin
Expand Down Expand Up @@ -130,11 +129,10 @@ jobs:
shell: bash

- name: Install tools on macOS
run: brew install ninja llvm
run: brew install ninja

- name: Compile skia
run: |
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
node ./scripts/build-skia.js --target=aarch64-apple-darwin
env:
Expand Down
10 changes: 10 additions & 0 deletions scripts/build-skia.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ switch (TARGET_TRIPLE) {
ExtraSkiaBuildFlag += ' target_cpu="x64" target_os="mac"'
ExtraCflagsCC += ',"-Wno-psabi"'
}
ExtraCflagsCC += ', "-mmacosx-version-min=10.13"'
ExtraLdFlags = ' "-mmacosx-version-min=10.13"'
ExtraAsmFlags = '"-mmacosx-version-min=10.13"'
ExtraCflags = '"-mmacosx-version-min=10.13"'
GN_ARGS.push(
`extra_ldflags=[${ExtraLdFlags}]`,
`extra_asmflags=[${ExtraAsmFlags}]`,
`extra_cflags=[${ExtraCflags}]`,
`extra_cflags_c=[${ExtraCflags}]`,
)
break
case '':
break
Expand Down

0 comments on commit b099c0a

Please sign in to comment.