diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 11:47:39 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 12:01:16 -0300 |
| commit | a0ca9a0bfa76cd2d04502b7f341cba5153f51899 (patch) | |
| tree | 0864fc8d1dd07a72aab729beb03ae3fdc8f24076 /build.zig | |
| parent | 62183e7ce8e6da7d22be451683376066a8bcd282 (diff) | |
| download | computeranim-a0ca9a0bfa76cd2d04502b7f341cba5153f51899.tar.gz computeranim-a0ca9a0bfa76cd2d04502b7f341cba5153f51899.zip | |
build: C targets without UBSan, whose checks would be traced too
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -13,9 +13,10 @@ pub const Ctx = struct { test_step: *std.Build.Step, /// A C program to trace, from `targets/`: -O1 with debug info, frame - /// pointers kept, so its code is short and still maps to its source. + /// pointers kept, so its code is short and still maps to its source; no + /// UBSan (Zig's default in Debug), whose checks would be traced too. pub fn cTarget(ctx: Ctx, name: []const u8, files: []const []const u8) *std.Build.Step.Compile { - const mod = ctx.b.createModule(.{ .target = ctx.target, .optimize = .Debug, .link_libc = true, .omit_frame_pointer = false }); + const mod = ctx.b.createModule(.{ .target = ctx.target, .optimize = .Debug, .link_libc = true, .omit_frame_pointer = false, .sanitize_c = .off }); mod.addCSourceFiles(.{ .root = ctx.b.path("targets"), .files = files, .flags = &.{ "-O1", "-g", "-fno-omit-frame-pointer" } }); return ctx.b.addExecutable(.{ .name = name, .root_module = mod }); } |
