Skip to content

Commit a16c3fe

Browse files
authored
Merge pull request #157 from vrischmann/update-latest-zig
fix for latest zig
2 parents f630876 + 48f7dcc commit a16c3fe

File tree

5 files changed

+209
-190
lines changed

5 files changed

+209
-190
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
lint:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- uses: goto-bus-stop/setup-zig@v2
2424
with:
2525
version: master
@@ -39,7 +39,7 @@ jobs:
3939
with:
4040
version: master
4141

42-
- uses: actions/cache@v3
42+
- uses: actions/cache@v4
4343
if: ${{ matrix.os != 'windows-latest' }}
4444
with:
4545
path: |

build.zig

+5-14
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ pub fn build(b: *std.Build) !void {
279279
.flags = &[_][]const u8{"-std=c99"},
280280
});
281281
sqlite_lib.linkLibC();
282-
sqlite_lib.installHeader("c/sqlite3.h", "sqlite3.h");
282+
sqlite_lib.installHeader(.{ .path = "c/sqlite3.h" }, "sqlite3.h");
283283

284284
b.installArtifact(sqlite_lib);
285285

@@ -399,9 +399,7 @@ pub fn build(b: *std.Build) !void {
399399
fuzz_lib.linkLibrary(lib);
400400
fuzz_lib.want_lto = true;
401401
fuzz_lib.bundle_compiler_rt = true;
402-
fuzz_lib.root_module.addImport("sqlite", b.createModule(.{
403-
.root_source_file = .{ .path = "sqlite.zig" },
404-
}));
402+
fuzz_lib.root_module.addImport("sqlite", sqlite_mod);
405403

406404
// Setup the output name
407405
const fuzz_executable_name = "fuzz";
@@ -430,9 +428,7 @@ pub fn build(b: *std.Build) !void {
430428
});
431429
fuzz_debug_exe.addIncludePath(.{ .path = "c" });
432430
fuzz_debug_exe.linkLibrary(lib);
433-
fuzz_debug_exe.root_module.addImport("sqlite", b.createModule(.{
434-
.root_source_file = .{ .path = "sqlite.zig" },
435-
}));
431+
fuzz_debug_exe.root_module.addImport("sqlite", sqlite_mod);
436432

437433
// Only install fuzz-debug when the fuzz step is run
438434
const install_fuzz_debug_exe = b.addInstallArtifact(fuzz_debug_exe, .{});
@@ -453,11 +449,8 @@ pub fn build(b: *std.Build) !void {
453449
.target = getTarget(target, true),
454450
.optimize = optimize,
455451
});
456-
zigcrypto_loadable_ext.pie = true;
457452
zigcrypto_loadable_ext.addIncludePath(.{ .path = "c" });
458-
zigcrypto_loadable_ext.root_module.addImport("sqlite", b.createModule(.{
459-
.root_source_file = .{ .path = "sqlite.zig" },
460-
}));
453+
zigcrypto_loadable_ext.root_module.addImport("sqlite", sqlite_mod);
461454
zigcrypto_loadable_ext.linkLibrary(lib);
462455

463456
const install_zigcrypto_loadable_ext = b.addInstallArtifact(zigcrypto_loadable_ext, .{});
@@ -469,9 +462,7 @@ pub fn build(b: *std.Build) !void {
469462
.optimize = optimize,
470463
});
471464
zigcrypto_test.addIncludePath(.{ .path = "c" });
472-
zigcrypto_test.root_module.addImport("sqlite", b.createModule(.{
473-
.root_source_file = .{ .path = "sqlite.zig" },
474-
}));
465+
zigcrypto_test.root_module.addImport("sqlite", sqlite_mod);
475466
zigcrypto_test.linkLibrary(lib);
476467

477468
const install_zigcrypto_test = b.addInstallArtifact(zigcrypto_test, .{});

0 commit comments

Comments
 (0)