Skip to content

Commit

Permalink
WriteFiles fixed
Browse files Browse the repository at this point in the history
note: this hack avoids adding AddIncludePath because of step priorities when getting WritedFiles - giving a build error.
  • Loading branch information
kassane committed Oct 7, 2024
1 parent 9378d72 commit 80bf6c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ pub fn buildLibSokol(b: *Build, options: LibSokolOptions) !*CompileStep {
try lib.root_module.include_dirs.append(b.allocator, dir);
}
lib.linkLibrary(cimgui);
// TODO: this is a hack to get the cimgui.h header into the include path
const cimgui_include = b.dependency("cimgui", .{}).path("");
lib.addIncludePath(cimgui_include);
}
return lib;
}
Expand Down Expand Up @@ -899,15 +902,15 @@ fn buildImgui(b: *Build, options: libImGuiOptions) !*CompileStep {
.optimize = options.optimize,
});

// libimgui compilation depends on file tree
libimgui.step.dependOn(&wf.step);

if (libimgui.linkage == .static)
libimgui.pie = true
else if (libimgui.linkage == .static)
libimgui.root_module.pic = true;
libimgui.addIncludePath(cimgui_dir);
libimgui.addIncludePath(imgui_cpp_dir);

// FIXME: this is a hack to make cimgui work on build.zig | NOT USE C/IMGUI INCLUDES (get BUILD [Step] ERRORS)
// libimgui.addIncludePath(cimgui_dir);
// libimgui.addAfterIncludePath(imgui_cpp_dir);

if (libimgui.rootModuleTarget().isWasm()) {
if (try emSdkSetupStep(b, options.emsdk.?)) |emsdk_setup| {
libimgui.step.dependOn(&emsdk_setup.step);
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
.hash = "12204b1441f1407af838a3e6f8423ee9cb2cf7b07114ec077b1ec0a233d4b78672c9",
},
.imgui = .{
.url = "git+https://github.com/ocornut/imgui#v1.91.2-docking",
.hash = "1220388fad9c32584aec3bba9ccdf7d240ab4e81999e0e567a2d832e54177d908daf",
.url = "git+https://github.com/ocornut/imgui#v1.91.3-docking",
.hash = "1220028f6acbeeb6b05837301353a91fb05dbe6ca283a7c3277efee43a5b98c57838",
},
.emsdk = .{
.url = "git+https://github.com/emscripten-core/emsdk#3.1.67",
Expand Down

0 comments on commit 80bf6c3

Please sign in to comment.