diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 83ad66444a..2aa3ce9c5c 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -701,17 +701,24 @@ fn (mut c Builder) cc_windows_cross() { if !c.pref.out_name.ends_with('.exe') { c.pref.out_name += '.exe' } - mut args := '-o $c.pref.out_name -w -L. ' + mut args := '' + args += ' $c.pref.cflags ' + args += ' -o $c.pref.out_name -w -L. ' + // cflags := c.get_os_cflags() // -I flags args += if c.pref.ccompiler == 'msvc' { cflags.c_options_before_target_msvc() } else { cflags.c_options_before_target() } mut optimization_options := '' mut debug_options := '' if c.pref.is_prod { - optimization_options = if c.pref.ccompiler == 'msvc' { '' } else { ' -O3 -fno-strict-aliasing -flto ' } + if c.pref.ccompiler != 'msvc' { + optimization_options = ' -O3 -fno-strict-aliasing -flto ' + } } if c.pref.is_debug { - debug_options = if c.pref.ccompiler == 'msvc' { '' } else { ' -g3 -no-pie ' } + if c.pref.ccompiler != 'msvc' { + debug_options = ' -O0 -g -gdwarf-2 ' + } } mut libs := '' if false && c.pref.build_mode == .default_mode {