fix(build): correctly disable sanitizers in zig build script when WHOA_UB_SAN is false or release mode is not debug

This commit is contained in:
phaneron 2024-07-22 02:05:52 -04:00
parent 1b4f1dba86
commit b93c615368
2 changed files with 6 additions and 2 deletions

View file

@ -111,9 +111,11 @@ pub fn build(b: *std.Build) void {
if (ub_san) {
// Disable UBsan alignment checks only
whoa_compiler_flags_list.append("-fno-sanitize=alignment") catch {};
whoa_compiler_flags_list.append("-fno-sanitize=float-cast-overflow") catch {};
whoa_compiler_flags_list.append("-fno-sanitize=signed-integer-overflow") catch {};
} else {
// Disable UBsan
whoa_compiler_flags_list.append("-fsanitize=undefined") catch {};
whoa_compiler_flags_list.append("-fno-sanitize=all") catch {};
}
var build_gll = false;