Skip to content

Commit

Permalink
Add build option to disable C++ exceptions (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-day-old-bagel authored Jan 18, 2025
1 parent c545c87 commit d4fbf9b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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",
};
Expand Down

0 comments on commit d4fbf9b

Please sign in to comment.