Skip to content

Commit

Permalink
Don't require git for building
Browse files Browse the repository at this point in the history
  • Loading branch information
mlafeldt committed Jan 22, 2025
1 parent 8ecf2bb commit b81c0ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ pub fn build(b: *std.Build) !void {
const install_headers = b.option(bool, "install-headers", "Install DuckDB C headers") orelse false;

const ext_version = v: {
const git_describe = b.run(&[_][]const u8{
var code: u8 = undefined;
const git_describe = b.runAllowFail(&[_][]const u8{
"git",
"-C",
b.build_root.path orelse ".",
Expand All @@ -41,7 +42,7 @@ pub fn build(b: *std.Build) !void {
"--match",
"v[0-9]*",
"--always",
});
}, &code, .Ignore) catch "n/a";
break :v std.mem.trim(u8, git_describe, " \n\r");
};

Expand All @@ -64,7 +65,9 @@ pub fn build(b: *std.Build) !void {
.optimize = optimize,
});
ext.addCSourceFiles(.{
.files = &.{"quack_extension.c"},
.files = &.{
"quack_extension.c",
},
.flags = &cflags,
});
ext.addIncludePath(duckdb.path(""));
Expand Down

0 comments on commit b81c0ee

Please sign in to comment.