@@ -5,6 +5,17 @@ pub fn build(b: *std.Build) !void {
5
5
const target = b .standardTargetOptions (.{});
6
6
const optimize = b .standardOptimizeOption (.{});
7
7
8
+ const no_fail = b .option (bool , "no_fail" , "Ignore build panic" ) orelse false ;
9
+
10
+ switch (target .result .os .tag ) {
11
+ .windows , .macos , .linux = > {},
12
+ else = > if (no_fail ) return else @panic ("Unsupported OS" ),
13
+ }
14
+ switch (target .result .cpu .arch ) {
15
+ .x86_64 , .arm , .aarch64 , .riscv64 = > {},
16
+ else = > if (no_fail ) return else @panic ("Unsupported CPU architecture" ),
17
+ }
18
+
8
19
const tcc_dep = b .dependency ("tinycc" , .{});
9
20
10
21
const build_native_target : std.Build.ResolvedTarget = .{
@@ -91,7 +102,7 @@ pub fn build(b: *std.Build) !void {
91
102
for (RISCV64_SOURCES ) | file |
92
103
try C_SOURCES .append (file );
93
104
},
94
- else = > @panic ( "Unsupported CPU architecture" ) ,
105
+ else = > unreachable ,
95
106
}
96
107
97
108
switch (os_tag ) {
@@ -104,7 +115,7 @@ pub fn build(b: *std.Build) !void {
104
115
try C_SOURCES .append (file );
105
116
},
106
117
.linux = > {},
107
- else = > @panic ( "Unsupported OS" ) ,
118
+ else = > unreachable ,
108
119
}
109
120
110
121
switch (cpu_arch ) {
0 commit comments