feature. See also
. The project being documented here (as the example) is the Zig library itself.
Configuration.Module
pub const Module = struct
File
Code
pub const Module = struct {
flags: Flags,
flags2: Flags2,
import_table: ImportTable.Index,
owner: Package.Index,
root_source_file: LazyPath.OptionalIndex,
resolved_target: ResolvedTarget.OptionalIndex,
c_macros: Storage.FlagLengthPrefixedList(.flags, .c_macros, String),
lib_paths: Storage.FlagLengthPrefixedList(.flags, .lib_paths, LazyPath.Index),
export_symbol_names: Storage.FlagLengthPrefixedList(.flags, .export_symbol_names, String),
include_dirs: Storage.UnionList(.flags, .include_dirs, IncludeDir),
rpaths: Storage.UnionList(.flags, .rpaths, RPath),
link_objects: Storage.UnionList(.flags, .link_objects, LinkObject),
frameworks: Storage.FlagLengthPrefixedList(.flags, .frameworks, Framework),
pub const Optimize = enum(u3) {
debug,
safe,
fast,
small,
default,
pub fn init(o: ?std.builtin.OptimizeMode) Optimize {
return switch (o orelse return .default) {
.debug => .debug,
.safe => .safe,
.fast => .fast,
.small => .small,
};
}
};
pub const UnwindTables = enum(u2) {
none,
sync,
async,
default,
pub fn init(ut: ?std.builtin.UnwindTables) UnwindTables {
return switch (ut orelse return .default) {
.none => .none,
.sync => .sync,
.async => .async,
};
}
};
pub const SanitizeC = enum(u2) {
off,
trap,
full,
default,
pub fn init(sc: ?std.zig.SanitizeC) SanitizeC {
return switch (sc orelse return .default) {
.off => .off,
.trap => .trap,
.full => .full,
};
}
};
pub const DwarfFormat = enum(u2) {
@"32",
@"64",
default,
pub fn init(df: ?std.dwarf.Format) DwarfFormat {
return switch (df orelse return .default) {
.@"32" => .@"32",
.@"64" => .@"64",
};
}
};
pub const Index = enum(u32) {
_,
pub fn get(this: @This(), c: *const Configuration) Module {
return extraData(c, Module, @backingInt(this));
}
};
pub const Flags = packed struct(u32) {
optimize: Optimize,
strip: DefaultingBool,
unwind_tables: UnwindTables,
dwarf_format: DwarfFormat,
single_threaded: DefaultingBool,
stack_protector: DefaultingBool,
stack_check: DefaultingBool,
sanitize_c: SanitizeC,
sanitize_thread: DefaultingBool,
fuzz: DefaultingBool,
code_model: std.builtin.CodeModel,
c_macros: bool,
include_dirs: bool,
lib_paths: bool,
rpaths: bool,
frameworks: bool,
link_objects: bool,
export_symbol_names: bool,
};
pub const Flags2 = packed struct(u32) {
valgrind: DefaultingBool,
pic: DefaultingBool,
red_zone: DefaultingBool,
omit_frame_pointer: DefaultingBool,
error_tracing: DefaultingBool,
link_libc: DefaultingBool,
link_libcpp: DefaultingBool,
no_builtin: DefaultingBool,
_: u16 = 0,
};
pub const IncludeDir = union(enum(u3)) {
path: LazyPath.Index,
path_system: LazyPath.Index,
path_after: LazyPath.Index,
framework_path: LazyPath.Index,
framework_path_system: LazyPath.Index,
config_header_step: Step.Index,
embed_path: LazyPath.Index,
};
pub const RPath = union(enum(u1)) {
lazy_path: LazyPath.Index,
special: String,
};
pub const LinkObject = union(enum(u3)) {
static_path: LazyPath.Index,
other_step: Step.Index,
system_lib: SystemLib.Index,
assembly_file: LazyPath.Index,
c_source_file: CSourceFile.Index,
c_source_files: CSourceFiles.Index,
win32_resource_file: RcSourceFile.Index,
};
pub const Framework = extern struct {
flags: @This().Flags,
name: String,
pub const Flags = packed struct(u32) {
needed: bool,
weak: bool,
_: u30 = 0,
};
};
}