Skip to content

Commit

Permalink
For cross-compilation have to make sure setTarget and setMode also ap…
Browse files Browse the repository at this point in the history
…plies to

sqlite

See vrischmann/zig-sqlite#107
  • Loading branch information
malcolmstill committed Nov 3, 2022
1 parent fe294d3 commit ee282d1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Clerk release
name: clerk release
on:
push:
tags:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ jobs:
with:
version: 0.10.0
- run: zig build
build_x86_64-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.10.0
- run: zig build -Dtarget=x86_64-linux
build_aarch64-macos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.10.0
- run: zig build -Dtarget=aarch64-macos
lint:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub fn build(b: *std.build.Builder) void {

const sqlite = b.addStaticLibrary("sqlite", null);
sqlite.addCSourceFile("lib/zig-sqlite/c/sqlite3.c", &[_][]const u8{ "-std=c99", "-DSQLITE_ENABLE_FTS5" });
sqlite.setTarget(target);
sqlite.setBuildMode(mode);
sqlite.linkLibC();

const exe = b.addExecutable("clerk", "src/main.zig");
Expand Down

0 comments on commit ee282d1

Please sign in to comment.