File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,16 @@ pub fn (opt CompileOptions) uses_gc() bool {
57
57
return uses_gc
58
58
}
59
59
60
+ // has_v_d_flag returns true if `d_flag` (-d <ident>) can be found among the passed v flags.
61
+ pub fn (opt CompileOptions) has_v_d_flag (d_flag string ) bool {
62
+ for v_flag in opt.v_flags {
63
+ if v_flag.contains ('-d ${d_flag} ' ) {
64
+ return true
65
+ }
66
+ }
67
+ return false
68
+ }
69
+
60
70
// is_debug_build returns true if either `-cg` or `-g` flags is found among the passed v flags.
61
71
pub fn (opt CompileOptions) is_debug_build () bool {
62
72
return '-cg' in opt.v_flags || '-g' in opt.v_flags
@@ -695,7 +705,9 @@ pub fn compile_v_c_dependencies(opt CompileOptions, v_meta_info VMetaInfo) !VImp
695
705
defines << '-DGC_ASSERTIONS'
696
706
defines << '-DGC_ANDROID_LOG'
697
707
}
698
- defines << '-DGC_THREADS=1'
708
+ if ! opt.has_v_d_flag ('no_gc_threads' ) {
709
+ defines << '-DGC_THREADS=1'
710
+ }
699
711
defines << '-DGC_BUILTIN_ATOMIC=1'
700
712
defines << '-D_REENTRANT'
701
713
// NOTE it's currently a little unclear why this is needed.
You can’t perform that action at this time.
0 commit comments