╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ print_targets.zig ────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
105 { 106 var cpu_obj = try native_obj.beginStructField("cpu", .{}); 107 try cpu_obj.field("arch", @tagName(native_target.cpu.arch), .{}); 108 109 try cpu_obj.field("name", native_target.cpu.model.name, .{}); 110 111 { 112 var features = try native_obj.beginTupleField("features", .{}); 113 for (native_target.cpu.arch.allFeaturesList(), 0..) |feature, i_usize| { 114 const index = @as(Target.Cpu.Feature.Set.Index, @intCast(i_usize)); 115 if (native_target.cpu.features.isEnabled(index)) { 116 try features.field(feature.name, .{}); 117 } 118 } 119 try features.end(); 120 } 121 try cpu_obj.end(); 122 } 123 124 try native_obj.field("os", @tagName(native_target.os.tag), .{}); 125 try native_obj.field("abi", @tagName(native_target.abi), .{}); 126 try native_obj.end(); 127 } 128 129 try root_obj.end(); 130 } 131 132 try out.writeByte('\n'); 133 } 134