@@ -7,6 +7,11 @@ pub fn build(b: *std.Build) !void {
7
7
8
8
const no_fail = b .option (bool , "no_fail" , "Ignore build panic" ) orelse false ;
9
9
10
+ // TinyCC options
11
+ const CONFIG_TCC_BCHECK = b .option (bool , "CONFIG_TCC_BCHECK" , "compile with built-in memory and bounds checker (implies -g)" ) orelse true ;
12
+ const CONFIG_TCC_BACKTRACE = b .option (bool , "CONFIG_TCC_BACKTRACE" , "link with backtrace (stack dump) support [show max N callers]" ) orelse true ;
13
+ const CONFIG_MEM_DEBUG = b .option (bool , "CONFIG_MEM_DEBUG" , "compile with MEM_DEBUG flag defined for tcc" ) orelse false ;
14
+
10
15
switch (target .result .os .tag ) {
11
16
.windows , .macos , .linux = > {},
12
17
else = > if (no_fail ) return else @panic ("Unsupported OS" ),
@@ -73,13 +78,11 @@ pub fn build(b: *std.Build) !void {
73
78
try FLAGS .append ("-DONE_SOURCE=0" );
74
79
try FLAGS .append ("-DTCC_LIBTCC1=\" \\ 0\" " );
75
80
76
- if (! ( b . option ( bool , " CONFIG_TCC_BCHECK" , "compile with built-in memory and bounds checker (implies -g)" ) orelse true ) )
81
+ if (! CONFIG_TCC_BCHECK )
77
82
try FLAGS .append ("-DCONFIG_TCC_BCHECK=0" );
78
-
79
- if (! (b .option (bool , "CONFIG_TCC_BACKTRACE" , "link with backtrace (stack dump) support [show max N callers]" ) orelse true ))
83
+ if (! CONFIG_TCC_BACKTRACE )
80
84
try FLAGS .append ("-DCONFIG_TCC_BACKTRACE=0" );
81
-
82
- if (b .option (bool , "CONFIG_MEM_DEBUG" , "compile with MEM_DEBUG flag defined for tcc" ) orelse false )
85
+ if (CONFIG_MEM_DEBUG )
83
86
try FLAGS .append ("-DMEM_DEBUG=2" );
84
87
85
88
for (SOURCES ) | file |
0 commit comments