From a25c4bb59f89dbe483988598b74c2b54d6449c59 Mon Sep 17 00:00:00 2001 From: Justice Suh Date: Tue, 2 Jul 2019 21:16:26 -0400 Subject: [PATCH] compiler: add debug flag --- compiler/main.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/main.v b/compiler/main.v index d28e7f2727..78b369961a 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -90,6 +90,7 @@ mut: is_run bool show_c_cmd bool // `v -show_c_cmd` prints the C command to build program.v.c sanitize bool // use Clang's new "-fsanitize" option + is_debug bool // keep compiled C files } @@ -615,7 +616,7 @@ mut args := '' } println('linux cross compilation done. resulting binary: "$v.out_name"') } - if v.out_name_c != 'v.c' && v.out_name_c != 'v_macos.c' { + if !v.pref.is_debug && v.out_name_c != 'v.c' && v.out_name_c != 'v_macos.c' { os.rm('$TmpPath/$v.out_name_c') } } @@ -925,6 +926,7 @@ fn new_v(args[]string) *V { is_play: args.contains('play') is_prod: args.contains('-prod') is_verbose: args.contains('-verbose') + is_debug: args.contains('-debug') obfuscate: obfuscate is_prof: args.contains('-prof') is_live: args.contains('-live')