Skip to content

Commit

Permalink
disable ubsan when building for wasm (fixes #102)
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Mar 1, 2025
1 parent d1a67c4 commit b17a56e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ pub fn buildLibSokol(b: *Build, options: LibSokolOptions) !*Build.Step.Compile {
lib.linkSystemLibrary("EGL");
lib.linkSystemLibrary("android");
lib.linkSystemLibrary("log");
} else if (lib.rootModuleTarget().os.tag == .linux) {
} else if (isPlatform(lib.rootModuleTarget(), .linux)) {
if (options.use_egl) try cflags.append("-DSOKOL_FORCE_EGL");
if (!options.use_x11) try cflags.append("-DSOKOL_DISABLE_X11");
if (!options.use_wayland) try cflags.append("-DSOKOL_DISABLE_WAYLAND");
Expand All @@ -311,7 +311,7 @@ pub fn buildLibSokol(b: *Build, options: LibSokolOptions) !*Build.Step.Compile {
if (link_egl) {
lib.linkSystemLibrary("EGL");
}
} else if (lib.rootModuleTarget().os.tag == .windows) {
} else if (isPlatform(lib.rootModuleTarget(), .windows)) {
lib.linkSystemLibrary("kernel32");
lib.linkSystemLibrary("user32");
lib.linkSystemLibrary("gdi32");
Expand All @@ -320,6 +320,8 @@ pub fn buildLibSokol(b: *Build, options: LibSokolOptions) !*Build.Step.Compile {
lib.linkSystemLibrary("d3d11");
lib.linkSystemLibrary("dxgi");
}
} else if (isPlatform(lib.rootModuleTarget(), .web)) {
try cflags.append("-fno-sanitize=undefined");
}

// finally add the C source files
Expand Down

0 comments on commit b17a56e

Please sign in to comment.