Merge pull request #2307 from ghostty-org/push-yqnzysqxvuzl

Forward std_options from entrypoint in main.zig
This commit is contained in:
Mitchell Hashimoto
2024-09-27 10:53:06 -07:00
committed by GitHub

View File

@ -1,3 +1,4 @@
const std = @import("std");
const build_config = @import("build_config.zig"); const build_config = @import("build_config.zig");
/// See build_config.ExeEntrypoint for why we do this. /// 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. /// The main entrypoint for the program.
pub const main = entrypoint.main; 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 { test {
_ = entrypoint; _ = entrypoint;
} }