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 Function

unwrapTarget

Public Function
std.Build.Configuration.TargetQuery.unwrapTarget
pub fn unwrapTarget(tq: *const TargetQuery, c: *const Configuration) std.Target

Params

File

Build/Configuration.zig:2483
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
    pub fn unwrapTarget(tq: *const TargetQuery, c: *const Configuration) std.Target {
        const cpu_arch = tq.flags.cpu_arch.unwrap().?;
        const os_tag = tq.flags.os_tag.unwrap().?;
        return .{
            .cpu = .{
                .arch = cpu_arch,
                .model = cpu_arch.parseCpuModel(tq.cpu_name.value.?.slice(c)).?,
                .features = tq.cpu_features_add.value.?,
            },
            .os = .{
                .tag = os_tag,
                .version_range = switch (os_tag) {
                    .linux => .{ .linux = .{
                        .range = .{
                            .min = tq.os_version_min.u.unwrap(c).?.semver,
                            .max = tq.os_version_max.u.unwrap(c).?.semver,
                        },
                        .glibc = std.SemanticVersion.parse(tq.glibc_version.value.?.slice(c)) catch unreachable,
                        .android = tq.android_api_level.value.?,
                    } },
                    .hurd => .{ .hurd = .{
                        .range = .{
                            .min = tq.os_version_min.u.unwrap(c).?.semver,
                            .max = tq.os_version_max.u.unwrap(c).?.semver,
                        },
                        .glibc = std.SemanticVersion.parse(tq.glibc_version.value.?.slice(c)) catch unreachable,
                    } },
                    .windows => .{ .windows = .{
                        .min = tq.os_version_min.u.unwrap(c).?.windows,
                        .max = tq.os_version_max.u.unwrap(c).?.windows,
                    } },
                    else => switch (tq.os_version_min.u.unwrap(c).?) {
                        .none => .{ .none = {} },
                        .semver => |min| .{ .semver = .{
                            .min = min,
                            .max = tq.os_version_max.u.unwrap(c).?.semver,
                        } },
                        .windows => unreachable,
                    },
                },
            },
            .abi = tq.flags.abi.unwrap().?,
            .ofmt = tq.flags.object_format.unwrap().?,
            .dynamic_linker = .init(if (tq.dynamic_linker.value) |s| s.slice(c) else null),
        };
    }