Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
zig-cache
.zig-cache
zig-out
*.db
.zigmod
Expand Down
14 changes: 7 additions & 7 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
});
lib.installHeader(.{ .path = "src/sqlite3.h" }, "sqlite3.h");
lib.installHeader(.{ .path = "src/sqlite3ext.h" }, "sqlite3ext.h");
lib.addCSourceFile(.{ .file = .{ .path = "src/sqlite3.c" } });
lib.installHeader(b.path("src/sqlite3.h"), "sqlite3.h");
lib.installHeader(b.path("src/sqlite3ext.h"), "sqlite3ext.h");
lib.addCSourceFile(.{ .file = b.path("src/sqlite3.c") });
lib.linkLibC();
b.installArtifact(lib);

Expand All @@ -28,21 +28,21 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
});
shell.addCSourceFile(.{ .file = .{ .path = "src/shell.c" } });
shell.addCSourceFile(.{ .file = b.path("src/shell.c") });
shell.linkLibrary(lib);
if (should_install_shell) {
b.installArtifact(shell);
}

const module = b.addModule("sqlite3", .{
.root_source_file = .{ .path = "src/sqlite3.zig" },
.root_source_file = b.path("src/sqlite3.zig"),
.target = target,
.optimize = optimize,
});
module.linkLibrary(lib);

const test_exe = b.addTest(.{
.root_source_file = .{ .path = "src/sqlite3.zig" },
.root_source_file = b.path("src/sqlite3.zig"),
.target = target,
.optimize = optimize,
});
Expand All @@ -57,7 +57,7 @@ pub fn build(b: *std.Build) void {
inline for (EXAMPLES) |example_name| {
const example = b.addExecutable(.{
.name = example_name,
.root_source_file = .{ .path = "examples" ++ std.fs.path.sep_str ++ example_name ++ ".zig" },
.root_source_file = b.path("examples" ++ std.fs.path.sep_str ++ example_name ++ ".zig"),
.target = target,
.optimize = optimize,
});
Expand Down