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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Easy to use, hand-crafted API with default arguments, named parameters and Zig s

## Versions

* [ImGui](https://github.com/ocornut/imgui/tree/v1.91.8-docking) `1.91.8-docking`
* [ImGui test engine](https://github.com/ocornut/imgui_test_engine/tree/v1.91.8) `1.91.8`
* [ImPlot](https://github.com/epezent/implot) `O.17`
* [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) `1.89 WIP`
* [ImGuiNodeEditor](https://github.com/thedmd/imgui-node-editor/tree/v0.9.3) `O.9.3`
* [ImGui](https://github.com/ocornut/imgui/tree/v1.92.1-docking) `1.92.1-docking`
* [ImGui test engine](https://github.com/ocornut/imgui_test_engine/tree/v1.92.1) `1.92.1`
* [ImPlot](https://github.com/epezent/implot) `3da8bd3`
* [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) `1.91.3 WIP`
* [ImGuiNodeEditor](https://github.com/thedmd/imgui-node-editor/tree/v0.9.3) `e78e447`

## Getting started

Expand Down
40 changes: 22 additions & 18 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -93,29 +93,31 @@ pub fn build(b: *std.Build) void {
"-Wno-availability",
};

const imgui = if (options.shared) blk: {
const lib = b.addSharedLibrary(.{
.name = "imgui",
const imgui = b.addLibrary(.{
.name = "imgui",
.linkage = if (options.shared) .dynamic else .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
});
}),
});

imgui.root_module.addCMacro("IMGUI_DISABLE_OBSOLETE_FUNCTIONS", "");

if (options.shared) {
if (target.result.os.tag == .windows) {
lib.root_module.addCMacro("IMGUI_API", "__declspec(dllexport)");
lib.root_module.addCMacro("IMPLOT_API", "__declspec(dllexport)");
lib.root_module.addCMacro("ZGUI_API", "__declspec(dllexport)");
imgui.root_module.addCMacro("IMGUI_API", "__declspec(dllexport)");
imgui.root_module.addCMacro("IMGUI_IMPL_API", "extern \"C\" __declspec(dllexport)");
imgui.root_module.addCMacro("IMPLOT_API", "__declspec(dllexport)");
imgui.root_module.addCMacro("ZGUI_API", "__declspec(dllexport)");
} else {
imgui.root_module.addCMacro("IMGUI_IMPL_API", "extern \"C\"");
}

if (target.result.os.tag == .macos) {
lib.linker_allow_shlib_undefined = true;
imgui.linker_allow_shlib_undefined = true;
}

break :blk lib;
} else b.addStaticLibrary(.{
.name = "imgui",
.target = target,
.optimize = optimize,
});
}

b.installArtifact(imgui);

Expand Down Expand Up @@ -423,9 +425,11 @@ pub fn build(b: *std.Build) void {

const tests = b.addTest(.{
.name = "zgui-tests",
.root_source_file = b.path("src/gui.zig"),
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{
.root_source_file = b.path("src/gui.zig"),
.target = target,
.optimize = optimize,
}),
});
b.installArtifact(tests);

Expand Down
14 changes: 7 additions & 7 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.name = .zgui,
.fingerprint = 0xe78160e64acbef8,
.version = "0.6.0-dev",
.minimum_zig_version = "0.14.0",
.minimum_zig_version = "0.15.1",
.paths = .{
"build.zig",
"build.zig.zon",
Expand All @@ -18,18 +18,18 @@
.lazy = true,
},
.zglfw = .{
.url = "https://github.com/zig-gamedev/zglfw/archive/c337cb3d3f984468ea7a386335937a5d555fc024.tar.gz",
.hash = "zglfw-0.10.0-dev-zgVDNMacIQA-k7kNSfwUc9Lfzx-bb_wklVm25K-p8Tr7",
.url = "https://github.com/zig-gamedev/zglfw/archive/feeeff9386dd44ba2c18488113023865c41b80a4.tar.gz",
.hash = "zglfw-0.10.0-dev-zgVDNLyhIQCZR_rbIf7hnCKuifzcmPOLOQhd_hrqq8cl",
.lazy = true,
},
.zgpu = .{
.url = "https://github.com/zig-gamedev/zgpu/archive/d860e2b4a333cacffb168fab49a233c5d2f1bca2.tar.gz",
.hash = "zgpu-0.12.0-dev-nqFT5EKgCADkhwAf97_pfSOmPWEguKmljSECs9ihpFS7",
.url = "https://github.com/kcbanner/zgpu/archive/96f3ce2229e4836daec714a3f0b8c3c3218a6b2c.tar.gz",
.hash = "zgpu-0.12.0-dev-nqFT5LqgCACR_1wEhi7rveY3ocKJczfRaXQoisCmpohn",
.lazy = true,
},
.zsdl = .{
.url = "https://github.com/zig-gamedev/zsdl/archive/89c1fe2d7ef5020c68e71ac574195f09fc949cce.tar.gz",
.hash = "zsdl-0.4.0-dev-rFpjE5FXWQAHcbsSHDjFtbTkruSgvRVYOae6x8RXCnoM",
.url = "https://github.com/kcbanner/zsdl/archive/a764b0ee51a157a6133007e4f423a869df9e31d7.tar.gz",
.hash = "zsdl-0.4.0-dev-rFpjE2BgWQADibKkkIjv0Ig8k96MOu3Yeo6e0n9OD85L",
.lazy = true,
},
.freetype = .{
Expand Down
Loading
Loading