Package.Module: Make create() fall back on options.global.root_optimize_mode.

As is done for root_strip and root_error_tracing.
This commit is contained in:
Alex Rønne Petersen 2025-01-23 01:43:57 +01:00 committed by mlugg
parent ef4d7f01a5
commit 41185d297f
No known key found for this signature in database
GPG Key ID: 3F5B7DCCBF4AF02E
2 changed files with 3 additions and 1 deletions

View File

@ -56,6 +56,7 @@ export_memory: bool,
shared_memory: bool,
is_test: bool,
debug_format: DebugFormat,
root_optimize_mode: std.builtin.OptimizeMode,
root_strip: bool,
root_error_tracing: bool,
dll_export_fns: bool,
@ -508,6 +509,7 @@ pub fn resolve(options: Options) ResolveError!Config {
.use_lld = use_lld,
.wasi_exec_model = wasi_exec_model,
.debug_format = debug_format,
.root_optimize_mode = root_optimize_mode,
.root_strip = root_strip,
.dll_export_fns = dll_export_fns,
.rdynamic = rdynamic,

View File

@ -119,7 +119,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
const target = resolved_target.result;
const optimize_mode = options.inherited.optimize_mode orelse
if (options.parent) |p| p.optimize_mode else .Debug;
if (options.parent) |p| p.optimize_mode else options.global.root_optimize_mode;
const strip = b: {
if (options.inherited.strip) |x| break :b x;