Closed malcolmstill closed 3 months ago
Thanks ! this looks great.
Looks like a recent zig master
has moved std.rand
to std.Random
...I've updated the PR.
Thank you. I'll merge as is because the windows tests failing have nothing to do with your PR.
Amazing, thanks @vrischmann!
Description
This PR adds the ability to enable SQLite features (at this point only
fts5
) via build system options and in doing so allows customising SQLite features without resorting to vendoring (as per https://github.com/vrischmann/zig-sqlite?tab=readme-ov-file#using-the-bundled-sqlite-source-code-file).This means for example you can take the example of installation via the official package manager (https://github.com/vrischmann/zig-sqlite?tab=readme-ov-file#official-package-manager) and simply add, e.g.,
.fts5 = true
to the options to enable full text search:A
EnableOptions
struct
is added enumerating boolean options and instead of a static array with only-std=c99
as an option, we make the flags anArrayList
with the same initial content but use a comptimeinline for
to iterate over each field ofEnableOptions
to create ab.option
and add to theflags
ArrayList
when the given flag has been enabled. As reference this is the approach taken in https://github.com/mitchellh/zig-build-libxml2/blob/main/build.zig.As it stands this PR makes it easy to any
SQLITE_ENABLE_*
options by adding to theEnableOptions
struct
. This could be expanded to handle other options and indeed non-boolean options.Also updates
std.rand
->std.Random
as introduced in recent zigmaster
.