Automates much of the process of upgrading this repo to new Dear ImGUI versions
This commit is contained in:
parent
67e1f44f0f
commit
514e1e35e6
6 changed files with 135 additions and 36 deletions
52
build.zig
52
build.zig
|
|
@ -176,4 +176,56 @@ pub fn build(b: *std.Build) void {
|
|||
});
|
||||
const docs_step = b.step("docs", "Build the docs");
|
||||
docs_step.dependOn(&install_docs.step);
|
||||
|
||||
const dear_bindings = b.step("dear_bindings", "Update the cached bindings in this project's source tree to a new version of Dear ImGUI");
|
||||
dear_bindings: {
|
||||
const dear_bindings_path = b.graph.environ_map.get("DEAR_BINDINGS") orelse {
|
||||
dear_bindings.dependOn(&b.addFail("$DEAR_BINDINGS not set").step);
|
||||
break :dear_bindings;
|
||||
};
|
||||
{
|
||||
const run = b.addSystemCommand(&.{ "python3", dear_bindings_path });
|
||||
run.addArg("--imconfig-path");
|
||||
run.addFileArg(b.path("src/include/imconfig_zig.h"));
|
||||
run.addArg("-o");
|
||||
run.addArg("src/cached/dcimgui");
|
||||
run.addFileArg(upstream.path("imgui.h"));
|
||||
dear_bindings.dependOn(&run.step);
|
||||
run.has_side_effects = true;
|
||||
}
|
||||
{
|
||||
const run = b.addSystemCommand(&.{ "python3", dear_bindings_path });
|
||||
run.addArg("--imconfig-path");
|
||||
run.addFileArg(b.path("src/include/imconfig_zig.h"));
|
||||
run.addArg("-o");
|
||||
run.addArg("src/cached/dcimgui_internal");
|
||||
run.addFileArg(upstream.path("imgui_internal.h"));
|
||||
run.addArg("--include");
|
||||
run.addFileArg(upstream.path("imgui.h"));
|
||||
dear_bindings.dependOn(&run.step);
|
||||
run.has_side_effects = true;
|
||||
}
|
||||
{
|
||||
const run = b.addSystemCommand(&.{ "python3", dear_bindings_path });
|
||||
run.addArg("--backend");
|
||||
run.addArg("--imconfig-path");
|
||||
run.addFileArg(b.path("src/include/imconfig_zig.h"));
|
||||
run.addArg("-o");
|
||||
run.addArg("src/cached/dcimgui_impl_vulkan");
|
||||
run.addFileArg(upstream.path("backends/imgui_impl_vulkan.h"));
|
||||
dear_bindings.dependOn(&run.step);
|
||||
run.has_side_effects = true;
|
||||
}
|
||||
{
|
||||
const run = b.addSystemCommand(&.{ "python3", dear_bindings_path });
|
||||
run.addArg("--backend");
|
||||
run.addArg("--imconfig-path");
|
||||
run.addFileArg(b.path("src/include/imconfig_zig.h"));
|
||||
run.addArg("-o");
|
||||
run.addArg("src/cached/dcimgui_impl_sdl3");
|
||||
run.addFileArg(upstream.path("backends/imgui_impl_sdl3.h"));
|
||||
dear_bindings.dependOn(&run.step);
|
||||
run.has_side_effects = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue