Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

ParseOptions

Public Struct
std.Target.Query.ParseOptions
pub const ParseOptions = struct

Fields

arch_os_abi: []const u8 = "native"

This is sometimes called a "triple". It looks roughly like this: riscv64-linux-musl The fields are, respectively:

  • CPU Architecture
  • Operating System (and optional version range)
  • C ABI (optional, with optional glibc version or Android API level) The string "native" can be used for CPU architecture as well as Operating System. If the CPU Architecture is specified as "native", then the Operating System and C ABI may be omitted.
cpu_features: ?[]const u8 = null

Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e" are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features to remove from the set. The following special strings are recognized for CPU Model name:

  • "baseline" - The "default" set of CPU features for cross-compiling. A conservative set of features that is expected to be supported on most available hardware.
  • "native" - The native CPU model is to be detected when compiling. If this field is not provided (null), then the value will depend on the parsed CPU Architecture. If native, then this will be "native". Otherwise, it will be "baseline".
dynamic_linker: ?[]const u8 = null

Absolute path to dynamic linker, to override the default, which is either a natively detected path, or a standard path.

object_format: ?[]const u8 = null
diagnostics: ?*Diagnostics = null

If this is provided, the function will populate some information about parsing failures, so that user-friendly error messages can be delivered.

Structs

File

Target/Query.zig:156
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
pub const ParseOptions = struct {
    /// This is sometimes called a "triple". It looks roughly like this:
    ///     riscv64-linux-musl
    /// The fields are, respectively:
    /// * CPU Architecture
    /// * Operating System (and optional version range)
    /// * C ABI (optional, with optional glibc version or Android API level)
    /// The string "native" can be used for CPU architecture as well as Operating System.
    /// If the CPU Architecture is specified as "native", then the Operating System and C ABI may be omitted.
    arch_os_abi: []const u8 = "native",

    /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e"
    /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features
    /// to remove from the set.
    /// The following special strings are recognized for CPU Model name:
    /// * "baseline" - The "default" set of CPU features for cross-compiling. A conservative set
    ///                of features that is expected to be supported on most available hardware.
    /// * "native"   - The native CPU model is to be detected when compiling.
    /// If this field is not provided (`null`), then the value will depend on the
    /// parsed CPU Architecture. If native, then this will be "native". Otherwise, it will be "baseline".
    cpu_features: ?[]const u8 = null,

    /// Absolute path to dynamic linker, to override the default, which is either a natively
    /// detected path, or a standard path.
    dynamic_linker: ?[]const u8 = null,

    object_format: ?[]const u8 = null,

    /// If this is provided, the function will populate some information about parsing failures,
    /// so that user-friendly error messages can be delivered.
    diagnostics: ?*Diagnostics = null,

    pub const Diagnostics = struct {
        /// If the architecture was determined, this will be populated.
        arch: ?Target.Cpu.Arch = null,

        /// If the OS name was determined, this will be populated.
        os_name: ?[]const u8 = null,

        /// If the OS tag was determined, this will be populated.
        os_tag: ?Target.Os.Tag = null,

        /// If the ABI was determined, this will be populated.
        abi: ?Target.Abi = null,

        /// If the CPU name was determined, this will be populated.
        cpu_name: ?[]const u8 = null,

        /// If error.UnknownCpuFeature is returned, this will be populated.
        unknown_feature_name: ?[]const u8 = null,

        /// If error.UnknownArchitecture is returned, this will be populated.
        unknown_architecture_name: ?[]const u8 = null,
    };
}