Skip to content

Commit

Permalink
ci: try to set up macOS cross-compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
stancl committed Jan 2, 2025
1 parent 04ff761 commit 611195e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ jobs:
if: runner.os == 'Linux' && matrix.arch == 'ARM64'
uses: docker/setup-qemu-action@v3

- name: Build C files
if: runner.os != 'Linux' || matrix.arch != 'ARM64'
- name: Build C files (Native Windows)
if: runner.os == 'Windows'
run: cd extensions && make

- name: Build C files (Native Linux)
if: runner.os == 'Linux' && matrix.arch == 'X64'
run: cd extensions && make

- name: Build C files (Linux cross-compilation)
Expand All @@ -59,6 +63,20 @@ jobs:
debian:bookworm-slim \
bash -c "apt-get update && apt-get install -y make gcc && cd /extensions && make"
- name: Build C files (Native macOS ARM64)
if: matrix.os == 'macos-latest' && matrix.arch == 'ARM64'
run: cd extensions && make

- name: Build C files (macOS cross-compilation)
if: matrix.os == 'macos-latest' && matrix.arch == 'X64'
run: |
cd extensions
brew install llvm
export CC=/opt/homebrew/opt/llvm/bin/clang
export CFLAGS="-target x86_64-apple-darwin"
export LDFLAGS="-target x86_64-apple-darwin"
make
- name: Commit output files
shell: bash
run: |
Expand Down

0 comments on commit 611195e

Please sign in to comment.