Skip to content

Commit

Permalink
Show how to install multiple headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mlafeldt committed Jan 22, 2025
1 parent 47b0b2b commit eaf30ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ zig build --release=fast
# Optimize for binary size
zig build --release=small
# Also install DuckDB headers
# Also install DuckDB headers for development
zig build -Dinstall-headers
```

Expand Down
18 changes: 12 additions & 6 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,18 @@ pub fn build(b: *std.Build) !void {
).step);

if (install_headers) {
b.getInstallStep().dependOn(&b.addInstallDirectory(.{
.source_dir = duckdb.path(""),
.include_extensions = &.{"h"},
.install_dir = .header,
.install_subdir = "",
}).step);
const header_dirs = [_]std.Build.LazyPath{
duckdb.path(""),
// Add more header directories here
};
for (header_dirs) |dir| {
b.getInstallStep().dependOn(&b.addInstallDirectory(.{
.source_dir = dir,
.include_extensions = &.{"h"},
.install_dir = .header,
.install_subdir = "",
}).step);
}
}

// Run tests on native platform
Expand Down

0 comments on commit eaf30ee

Please sign in to comment.