summaryrefslogtreecommitdiffhomepage
path: root/src/build.zig
diff options
context:
space:
mode:
authorRyan Roden-Corrent <[email protected]>2023-09-05 05:02:25 -0400
committerGitHub <[email protected]>2023-09-05 11:02:25 +0200
commita316f9e7fc7f8e06852a40544e57f89018672ee4 (patch)
treec4dad2b6829541ddb2e1d73de61c23d73c76898e /src/build.zig
parentc104a975904f23d011cb6072f98945b8d38eff17 (diff)
downloadraylib-a316f9e7fc7f8e06852a40544e57f89018672ee4.tar.gz
raylib-a316f9e7fc7f8e06852a40544e57f89018672ee4.zip
Disable UBSAN in zig builds. (#3292)
Zig debug builds automatically enable ubsan. As the fix for #1891 had to be reverted, debug builds using zig will crash like so: ``` Illegal instruction at address 0x3237d2 raylib/src/rlgl.h:3690:91: 0x3237d2 in rlDrawVertexArrayElements (/home/rcorre/src/raylib-zig-template/raylib/src/rcore.c) glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (const unsigned short *)buffer + offset); ``` This disables UBSAN when using zig to build raylib.
Diffstat (limited to 'src/build.zig')
-rw-r--r--src/build.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/build.zig b/src/build.zig
index 27250f5f..09d954bf 100644
--- a/src/build.zig
+++ b/src/build.zig
@@ -6,6 +6,7 @@ pub fn addRaylib(b: *std.Build, target: std.zig.CrossTarget, optimize: std.built
"-std=gnu99",
"-D_GNU_SOURCE",
"-DGL_SILENCE_DEPRECATION=199309L",
+ "-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/1891
};
const raylib = b.addStaticLibrary(.{