╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ print_targets.zig ────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
81 try arch_obj.end(); 82 } 83 try cpus_obj.end(); 84 } 85 86 { 87 var cpu_features_obj = try root_obj.beginStructField("cpu_features", .{}); 88 for (meta.tags(Target.Cpu.Arch)) |arch| { 89 var arch_features = try cpu_features_obj.beginTupleField(@tagName(arch), .{}); 90 for (arch.allFeaturesList()) |feature| { 91 try arch_features.field(feature.name, .{}); 92 } 93 try arch_features.end(); 94 } 95 try cpu_features_obj.end(); 96 } 97 98 { 99 var native_obj = try root_obj.beginStructField("native", .{}); 100 { 101 const triple = try native_target.zigTriple(allocator); 102 defer allocator.free(triple); 103 try native_obj.field("triple", triple, .{}); 104 } 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