structstd.Build.Module.CreateOptions[src]

Unspecified options here will be inherited from parent Module when inserted into an import table.

Fields

root_source_file: ?LazyPath = null

This could either be a generated file, in which case the module contains exactly one file, or it could be a path to the root source file of directory of files which constitute the module. If null, it means this module is made up of only link_objects.

imports: []const Import = &.{}

The table of other modules that this module can access via @import. Imports are allowed to be cyclical, so this table can be added to after the Module is created via addImport.

target: ?std.Build.ResolvedTarget = null
optimize: ?std.builtin.OptimizeMode = null
link_libc: ?bool = null

true requires a compilation that includes this Module to link libc. false causes a build failure if a compilation that includes this Module would link libc. null neither requires nor prevents libc from being linked.

link_libcpp: ?bool = null

true requires a compilation that includes this Module to link libc++. false causes a build failure if a compilation that includes this Module would link libc++. null neither requires nor prevents libc++ from being linked.

single_threaded: ?bool = null
strip: ?bool = null
unwind_tables: ?std.builtin.UnwindTables = null
dwarf_format: ?std.dwarf.Format = null
code_model: std.builtin.CodeModel = .default
stack_protector: ?bool = null
stack_check: ?bool = null
sanitize_c: ?bool = null
sanitize_thread: ?bool = null
fuzz: ?bool = null
valgrind: ?bool = null

Whether to emit machine code that integrates with Valgrind.

pic: ?bool = null

Position Independent Code

red_zone: ?bool = null
omit_frame_pointer: ?bool = null

Whether to omit the stack frame pointer. Frees up a register and makes it more difficult to obtain stack traces. Has target-dependent effects.

error_tracing: ?bool = null

Source Code

Source code
pub const CreateOptions = struct {
    /// This could either be a generated file, in which case the module
    /// contains exactly one file, or it could be a path to the root source
    /// file of directory of files which constitute the module.
    /// If `null`, it means this module is made up of only `link_objects`.
    root_source_file: ?LazyPath = null,

    /// The table of other modules that this module can access via `@import`.
    /// Imports are allowed to be cyclical, so this table can be added to after
    /// the `Module` is created via `addImport`.
    imports: []const Import = &.{},

    target: ?std.Build.ResolvedTarget = null,
    optimize: ?std.builtin.OptimizeMode = null,

    /// `true` requires a compilation that includes this Module to link libc.
    /// `false` causes a build failure if a compilation that includes this Module would link libc.
    /// `null` neither requires nor prevents libc from being linked.
    link_libc: ?bool = null,
    /// `true` requires a compilation that includes this Module to link libc++.
    /// `false` causes a build failure if a compilation that includes this Module would link libc++.
    /// `null` neither requires nor prevents libc++ from being linked.
    link_libcpp: ?bool = null,
    single_threaded: ?bool = null,
    strip: ?bool = null,
    unwind_tables: ?std.builtin.UnwindTables = null,
    dwarf_format: ?std.dwarf.Format = null,
    code_model: std.builtin.CodeModel = .default,
    stack_protector: ?bool = null,
    stack_check: ?bool = null,
    sanitize_c: ?bool = null,
    sanitize_thread: ?bool = null,
    fuzz: ?bool = null,
    /// Whether to emit machine code that integrates with Valgrind.
    valgrind: ?bool = null,
    /// Position Independent Code
    pic: ?bool = null,
    red_zone: ?bool = null,
    /// Whether to omit the stack frame pointer. Frees up a register and makes it
    /// more difficult to obtain stack traces. Has target-dependent effects.
    omit_frame_pointer: ?bool = null,
    error_tracing: ?bool = null,
}