kivikakk / libpcre.zig

Zig bindings to libpcre
https://hrzn.ee/kivikakk/libpcre.zig
MIT License
20 stars 6 forks source link
pcre regular-expression zig

libpcre.zig

Build status

Use via the zig package manager (Zig v0.12+):

$ zig fetch --save https://github.com/kivikakk/libpcre.zig/archive/<commit hash>.tar.gz

Then add the following to build.zig (a source build of pcre will be linked against automatically):

const pcre_pkg = b.dependency("libpcre.zig", .{ .optimize = optimize, .target = target });
const pcre_mod = pcre_pkg.module("libpcre");
exe.root_module.addImport("pcre", pcre_mod);

To link against the system libpcre, add the system_library build option like this:

Note, only the following systems support this mode:

const pcre_pkg = b.dependency("libpcre.zig", .{ .optimize = optimize, .target = target, .system_library = "true" });