Skip to content

Commit

Permalink
chore: use zig cc to cross-compile for several platforms (#1)
Browse files Browse the repository at this point in the history
* use zig cc to cross compile for all targets

* chore: use `zig cc` to cross-compile for several platforms
  • Loading branch information
a10y authored Nov 18, 2024
1 parent 5da69fc commit f3a7e23
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 20 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,45 @@ on:


jobs:
publish-linux:
name: Build Linux amd64
build-aarch64-linux-gnu:
name: Build aarch64-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
./scripts/ci-build.sh
./scripts/ci-build.sh "aarch64-linux-gnu"
publish-macos:
name: Build macOS
build-x86_64-linux-gnu:
name: Build x86_64-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
./scripts/ci-build.sh "x86_64-linux-gnu"
build-aarch64-macos:
name: Build aarch64-macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
./scripts/ci-build.sh "aarch64-macos"
build-x86_64-macos:
name: Build x86_64-macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
./scripts/ci-build.sh
./scripts/ci-build.sh "x86_64-macos"
44 changes: 32 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,48 @@ on:


jobs:
publish-linux:
name: Publish Linux amd64
publish-aarch64-linux-gnu:
name: Publish aarch64-linux-gnu
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
./scripts/ci-build.sh
./scripts/ci-release.sh "${{ github.ref_name }}" linux
./scripts/ci-build.sh "aarch64-linux-gnu"
./scripts/ci-release.sh "aarch64-linux-gnu"
publish-macos:
name: Publish macOS
publish-x86_64-linux-gnu:
name: Publish x86_64-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
./scripts/ci-build.sh "x86_64-linux-gnu"
./scripts/ci-release.sh "x86_64-linux-gnu"
publish-aarch64-macos:
name: publish aarch64-macos
runs-on: macos-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
./scripts/ci-build.sh
./scripts/ci-release.sh "${{ github.ref_name }}" macos
./scripts/ci-build.sh "aarch64-macos"
./scripts/ci-release.sh "aarch64-macos"
publish-x86_64-macos:
name: Publish x86_64-macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
- name: Build
run: |
./scripts/ci-build.sh "x86_64-macos"
./scripts/ci-release.sh "x86_64-macos"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
################
## CHANGE NAME OF ANSI COMPILER HERE
################
CC = gcc
CC = zig cc -target $(TARGET)
# Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata)
# SQLSERVER, SYBASE, ORACLE, VECTORWISE
# Current values for MACHINE are: ATT, DOS, HP, IBM, ICL, MVS,
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

echo "making dbgen..."
make -j dbgen
make TARGET="$1" -j dbgen

0 comments on commit f3a7e23

Please sign in to comment.