Forward std_options from entrypoint in main.zig

This commit is contained in:
Mitchell Hashimoto
2024-09-27 10:50:43 -07:00
parent a753d94344
commit 08ee32b633

View File

@ -1,3 +1,4 @@
const std = @import("std");
const build_config = @import("build_config.zig");
/// See build_config.ExeEntrypoint for why we do this.
@ -16,6 +17,12 @@ const entrypoint = switch (build_config.exe_entrypoint) {
/// The main entrypoint for the program.
pub const main = entrypoint.main;
/// Standard options such as logger overrides.
pub const std_options: std.Options = if (@hasDecl(entrypoint, "std_options"))
entrypoint.std_options
else
.{};
test {
_ = entrypoint;
}