Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ zig-cache
zig-out
.direnv
.zig-cache
examples/comprehensive/examples
18 changes: 16 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,18 @@ pub fn build(b: *Build) !void {
// Function to generate API documentation
fn generate_docs(b: *Build, optimize: OptimizeMode, target: Build.ResolvedTarget, flags_module: *Module) void {
// Create a temporary object for documentation generation
const webui_lib = b.addObject(.{
const webui_lib = b.addObject(if (builtin.zig_version.minor == 14) .{
.name = "webui_lib",
.root_source_file = b.path(b.pathJoin(&.{ "src", "webui.zig" })),
.target = target,
.optimize = optimize,
} else .{
.name = "webui_lib",
.root_module = b.addModule("webui_lib", .{
.root_source_file = b.path(b.pathJoin(&.{ "src", "webui.zig" })),
.target = target,
.optimize = optimize,
}),
});

webui_lib.root_module.addImport("flags", flags_module);
Expand Down Expand Up @@ -153,11 +160,18 @@ fn build_examples(b: *Build, optimize: OptimizeMode, target: Build.ResolvedTarge
const path = b.pathJoin(&.{ "examples", example_name, "main.zig" });

// Create an executable for each example
const exe = b.addExecutable(.{
const exe = b.addExecutable(if (builtin.zig_version.minor == 14) .{
.name = example_name,
.root_source_file = b.path(path),
.target = target,
.optimize = optimize,
} else .{
.name = example_name,
.root_module = b.addModule(example_name, .{
.root_source_file = b.path(path),
.target = target,
.optimize = optimize,
}),
});

// Add the webui module and link against the library
Expand Down
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.{
.{
.name = .zig_webui,
.version = "2.5.0-beta.4",
.fingerprint = 0x95965ed3cdfb8c33,
.minimum_zig_version = "0.14.0",
.dependencies = .{
.webui = .{
.hash = "webui-2.5.0-beta.4-pxqD5bE4NwCVDCBguzzRmyOubiadAaVRNM0XMxqUv_GS",
.url = "https://github.com/webui-dev/webui/archive/e673cee5a26b4c475395ce8e2f5fb92608bf3574.tar.gz",
.hash = "webui-2.5.0-beta.4-pxqD5bY8NwAOad4eidLvvpn4UbMNNCtWnGlhPj5BScgZ",
.url = "https://github.com/webui-dev/webui/archive/ffb235a6e1ad0904a284836c205832bb47ec3ebe.tar.gz",
},
},
.paths = .{
Expand Down
Loading
Loading