Skip to content

Commit

Permalink
fix build.zig for building with sokol-imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed May 31, 2024
1 parent 40c318e commit c01b2c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pub const LibSokolOptions = struct {
use_x11: bool = true,
use_wayland: bool = false,
emsdk: ?*Build.Dependency = null,
cimgui: ?*Build.Dependency = null,
with_sokol_imgui: bool = false,
};
pub fn buildLibSokol(b: *Build, options: LibSokolOptions) !*Build.Step.Compile {
const lib = b.addStaticLibrary(.{
Expand Down Expand Up @@ -273,9 +273,9 @@ pub fn buildLibSokol(b: *Build, options: LibSokolOptions) !*Build.Step.Compile {
});
}

// optional Dear ImGui support by passing in an external cimgui dependency
if (options.cimgui) |cimgui| {
lib.addIncludePath(cimgui.path("."));
// optional Dear ImGui support, the called is required to also
// add the cimgui include path to the returned compile step
if (options.with_sokol_imgui) {
lib.addCSourceFile(.{
.file = b.path(csrc_root ++ "sokol_imgui.c"),
.flags = cflags,
Expand Down

0 comments on commit c01b2c9

Please sign in to comment.