Skip to content

Commit

Permalink
wasm: skip imgui example
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Apr 21, 2024
1 parent 1d1b2da commit e2392ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
dub build :debugtext_print
# dub build :cube
# dub build :blend
dub build :imgui
dub build :triangle
# dub build :mrt
dub build :user_data
Expand Down
23 changes: 15 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,18 @@ pub fn buildLibSokol(b: *Build, options: LibSokolOptions) !*CompileStep {
.flags = cflags,
});
}
lib.addCSourceFile(.{
.file = .{ .path = csrc_root ++ "sokol_imgui.c" },
.flags = cflags,
});
const cimgui = try buildImgui(b, .{ .target = options.target, .optimize = options.optimize, .emsdk = options.emsdk });
for (cimgui.root_module.include_dirs.items) |dir| {
try lib.root_module.include_dirs.append(b.allocator, dir);
// FIXME: missing 'assert.h'
if (!lib.rootModuleTarget().isWasm()) {
lib.addCSourceFile(.{
.file = .{ .path = csrc_root ++ "sokol_imgui.c" },
.flags = cflags,
});
const cimgui = try buildImgui(b, .{ .target = options.target, .optimize = options.optimize, .emsdk = options.emsdk });
for (cimgui.root_module.include_dirs.items) |dir| {
try lib.root_module.include_dirs.append(b.allocator, dir);
}
lib.linkLibrary(cimgui);
}
lib.linkLibrary(cimgui);
if (sharedlib)
b.installArtifact(lib);
return lib;
Expand Down Expand Up @@ -233,6 +236,10 @@ pub fn build(b: *Build) !void {
};

inline for (examples) |example| {
comptime {
if (builtin.cpu.arch.isWasm() and std.mem.eql(u8, example, "imgui"))
continue; // FIXME: cimgui need 'assert.h'.
}
const ldc = try ldcBuildStep(b, .{
.name = example,
.artifact = lib_sokol,
Expand Down

0 comments on commit e2392ec

Please sign in to comment.