authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-23 01:43:57+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-01-23 23:22:38+00:00
log41185d297ffcaf61776aa8e7610aea9d00fce3a4
tree7cff1564f7a71bb3d76d5f2cfa4158c2e339fa46
parentef4d7f01a5c26d8ed6fa8236d1b64e4091a51be3
signaturelock-open Commit is signed but in an unrecognized format.

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

As is done for root_strip and root_error_tracing.

2 files changed, 3 insertions(+), 1 deletions(-)

src/Compilation/Config.zig+2
......@@ -56,6 +56,7 @@ export_memory: bool,
5656shared_memory: bool,
5757is_test: bool,
5858debug_format: DebugFormat,
59root_optimize_mode: std.builtin.OptimizeMode,
5960root_strip: bool,
6061root_error_tracing: bool,
6162dll_export_fns: bool,
......@@ -508,6 +509,7 @@ pub fn resolve(options: Options) ResolveError!Config {
508509 .use_lld = use_lld,
509510 .wasi_exec_model = wasi_exec_model,
510511 .debug_format = debug_format,
512 .root_optimize_mode = root_optimize_mode,
511513 .root_strip = root_strip,
512514 .dll_export_fns = dll_export_fns,
513515 .rdynamic = rdynamic,
src/Package/Module.zig+1-1
......@@ -119,7 +119,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
119119 const target = resolved_target.result;
120120
121121 const optimize_mode = options.inherited.optimize_mode orelse
122 if (options.parent) |p| p.optimize_mode else .Debug;
122 if (options.parent) |p| p.optimize_mode else options.global.root_optimize_mode;
123123
124124 const strip = b: {
125125 if (options.inherited.strip) |x| break :b x;