Per-Build Config

The following options can be set on a per-project basis by placing zls.build.json in the project root directory next to build.zig.

OptionTypeDefault valueWhat it Does
relative_builtin_path?[]const u8nullIf present, this path is used to resolve @import("builtin")
build_options?[]BuildOptionnullIf present, this contains a list of user options to pass to the build. This is useful when options are used to conditionally add packages in build.zig.

BuildOption

BuildOption is defined as follows:

const BuildOption = struct {
    name: []const u8,
    value: ?[]const u8 = null,
};

When value is present, the option will be passed the same as in zig build -Dname=value. When value is null, the option will be passed as a flag instead as in zig build -Dflag.