From 674e0f9a240e2cffa5023e8f19a9891fa348629b Mon Sep 17 00:00:00 2001 From: adayoldbagel Date: Thu, 9 Jan 2025 15:05:33 -0700 Subject: [PATCH] Add build option to disable C++ exceptions --- build.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.zig b/build.zig index da40ecc..2d9e56d 100644 --- a/build.zig +++ b/build.zig @@ -30,6 +30,11 @@ pub fn build(b: *std.Build) void { "shared", "Build JoltC as shared lib", ) orelse false, + .no_exceptions = b.option( + bool, + "no_exceptions", + "Disable C++ Exceptions", + ) orelse false, }; const options_step = b.addOptions(); @@ -80,6 +85,7 @@ pub fn build(b: *std.Build) void { if (options.enable_debug_renderer) "-DJPH_DEBUG_RENDERER" else "", if (options.use_double_precision) "-DJPH_DOUBLE_PRECISION" else "", if (options.enable_asserts) "-DJPH_ENABLE_ASSERTS" else "", + if (options.no_exceptions) "-fno-exceptions" else "", "-fno-access-control", "-fno-sanitize=undefined", };