| ... | @@ -49,8 +49,6 @@ pub const Target = union(enum) { | ... | @@ -49,8 +49,6 @@ pub const Target = union(enum) { |
| 49 | other, | 49 | other, |
| 50 | | 50 | |
| 51 | pub fn parse(text: []const u8) !Os { | 51 | pub fn parse(text: []const u8) !Os { |
| 52 | if (mem.eql(u8, text, "native")) return builtin.os; | | |
| 53 | | | |
| 54 | const info = @typeInfo(Os); | 52 | const info = @typeInfo(Os); |
| 55 | inline for (info.Enum.fields) |field| { | 53 | inline for (info.Enum.fields) |field| { |
| 56 | if (mem.eql(u8, text, field.name)) { | 54 | if (mem.eql(u8, text, field.name)) { |
| ... | @@ -152,8 +150,6 @@ pub const Target = union(enum) { | ... | @@ -152,8 +150,6 @@ pub const Target = union(enum) { |
| 152 | } | 150 | } |
| 153 | | 151 | |
| 154 | pub fn parse(text: []const u8) !Abi { | 152 | pub fn parse(text: []const u8) !Abi { |
| 155 | if (mem.eql(u8, text, "native")) return builtin.abi; | | |
| 156 | | | |
| 157 | const info = @typeInfo(Abi); | 153 | const info = @typeInfo(Abi); |
| 158 | inline for (info.Enum.fields) |field| { | 154 | inline for (info.Enum.fields) |field| { |
| 159 | if (mem.eql(u8, text, field.name)) { | 155 | if (mem.eql(u8, text, field.name)) { |
| ... | @@ -582,8 +578,6 @@ pub const Target = union(enum) { | ... | @@ -582,8 +578,6 @@ pub const Target = union(enum) { |
| 582 | } | 578 | } |
| 583 | | 579 | |
| 584 | pub fn parse(text: []const u8) !Arch { | 580 | pub fn parse(text: []const u8) !Arch { |
| 585 | if (mem.eql(u8, text, "native")) return builtin.arch; | | |
| 586 | | | |
| 587 | const info = @typeInfo(Arch); | 581 | const info = @typeInfo(Arch); |
| 588 | inline for (info.Enum.fields) |field| { | 582 | inline for (info.Enum.fields) |field| { |
| 589 | if (mem.eql(u8, text, field.name)) { | 583 | if (mem.eql(u8, text, field.name)) { |
| ... | @@ -727,14 +721,12 @@ pub const Target = union(enum) { | ... | @@ -727,14 +721,12 @@ pub const Target = union(enum) { |
| 727 | /// * CPU Architecture | 721 | /// * CPU Architecture |
| 728 | /// * Operating System | 722 | /// * Operating System |
| 729 | /// * C ABI (optional) | 723 | /// * C ABI (optional) |
| 730 | /// "native" can be used for any of the fields. | | |
| 731 | arch_os_abi: []const u8, | 724 | arch_os_abi: []const u8, |
| 732 | | 725 | |
| 733 | /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e" | 726 | /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e" |
| 734 | /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features | 727 | /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features |
| 735 | /// to remove from the set. | 728 | /// to remove from the set. |
| 736 | /// The default value of `null` means to use the "baseline" feature set. | 729 | /// The default value of `null` means to use the "baseline" feature set. |
| 737 | /// "native" can be used to perform CPU introspection. | | |
| 738 | cpu: ?[]const u8 = null, | 730 | cpu: ?[]const u8 = null, |
| 739 | }; | 731 | }; |
| 740 | | 732 | |