msvc: generate PDB for prod builds

pull/2229/head
vitalyster 2019-10-04 16:09:45 +03:00 committed by Alexander Medvednikov
parent 52f4f4026b
commit d2c5b6d964
1 changed files with 9 additions and 7 deletions

View File

@ -230,8 +230,10 @@ pub fn (v mut V) cc_msvc() {
if v.pref.is_prod { if v.pref.is_prod {
a << '/O2' a << '/O2'
a << '/MD' a << '/MD'
a << '/Zi'
a << '/DNDEBUG'
} else { } else {
a << '/Z7' a << '/Zi'
a << '/MDd' a << '/MDd'
} }
@ -320,12 +322,12 @@ pub fn (v mut V) cc_msvc() {
a << '/LIBPATH:"$r.ucrt_lib_path"' a << '/LIBPATH:"$r.ucrt_lib_path"'
a << '/LIBPATH:"$r.um_lib_path"' a << '/LIBPATH:"$r.um_lib_path"'
a << '/LIBPATH:"$r.vs_lib_path"' a << '/LIBPATH:"$r.vs_lib_path"'
a << '/INCREMENTAL:NO' // Disable incremental linking a << '/DEBUG:FULL' // required for prod builds to generate PDB
if !v.pref.is_prod { if v.pref.is_prod {
a << '/DEBUG:FULL' a << '/INCREMENTAL:NO' // Disable incremental linking
} else { a << '/OPT:REF'
a << '/DEBUG:NONE' a << '/OPT:ICF'
} }
a << lib_paths a << lib_paths
@ -394,7 +396,7 @@ fn build_thirdparty_obj_file_with_msvc(path string, moduleflags []CFlag) {
btarget := moduleflags.c_options_before_target() btarget := moduleflags.c_options_before_target()
atarget := moduleflags.c_options_after_target() atarget := moduleflags.c_options_after_target()
cmd := '""$msvc.full_cl_exe_path" /volatile:ms /Z7 $include_string /c $btarget $cfiles $atarget /Fo"$obj_path""' cmd := '""$msvc.full_cl_exe_path" /volatile:ms /Zi /DNDEBUG $include_string /c $btarget $cfiles $atarget /Fo"$obj_path""'
//NB: the quotes above ARE balanced. //NB: the quotes above ARE balanced.
println('thirdparty cmd line: $cmd') println('thirdparty cmd line: $cmd')
res := os.exec(cmd) or { res := os.exec(cmd) or {