1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

msvc: unique names for pdb files, remove test job limit

This commit is contained in:
Emily Hudson 2020-06-26 16:16:15 +01:00 committed by GitHub
parent c83c5e7c61
commit 09236a438b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 11 deletions

1
.gitattributes vendored
View File

@ -1,2 +1,3 @@
*.v linguist-language=V text=auto eol=lf *.v linguist-language=V text=auto eol=lf
*.vv linguist-language=V text=auto eol=lf *.vv linguist-language=V text=auto eol=lf
*.bat text=auto eol=crlf

View File

@ -96,14 +96,6 @@ pub fn (mut ts TestSession) test() {
mtx: sync.new_mutex() mtx: sync.new_mutex()
} }
pool_of_test_runners.set_shared_context(ts) pool_of_test_runners.set_shared_context(ts)
$if msvc {
// NB: MSVC can not be launched in parallel, without giving it
// the option /FS because it uses a shared PDB file, which should
// be locked, but that makes writing slower...
// See: https://docs.microsoft.com/en-us/cpp/build/reference/fs-force-synchronous-pdb-writes?view=vs-2019
// Instead, just run tests on 1 core for now.
pool_of_test_runners.set_max_jobs(1)
}
pool_of_test_runners.work_on_pointers(remaining_files.pointers()) pool_of_test_runners.work_on_pointers(remaining_files.pointers())
ts.benchmark.stop() ts.benchmark.stop()
eprintln(term.h_divider('-')) eprintln(term.h_divider('-'))

View File

@ -200,6 +200,7 @@ pub fn (mut v Builder) cc_msvc() {
return return
} }
out_name_obj := os.real_path(v.out_name_c + '.obj') out_name_obj := os.real_path(v.out_name_c + '.obj')
out_name_pdb := os.real_path(v.out_name_c + '.pdb')
// Default arguments // Default arguments
// volatile:ms enables atomic volatile (gcc _Atomic) // volatile:ms enables atomic volatile (gcc _Atomic)
// -w: no warnings // -w: no warnings
@ -209,12 +210,17 @@ pub fn (mut v Builder) cc_msvc() {
if v.pref.is_prod { if v.pref.is_prod {
a << '/O2' a << '/O2'
a << '/MD' a << '/MD'
a << '/Zi'
a << '/DNDEBUG' a << '/DNDEBUG'
} else { } else {
a << '/Zi'
a << '/MDd' a << '/MDd'
} }
if v.pref.is_debug {
// /Zi generates a .pdb
// /Fd sets the pdb file name (so its not just vc140 all the time)
a << ['/Zi', '/Fd"$out_name_pdb"']
}
if v.pref.is_shared { if v.pref.is_shared {
if !v.pref.out_name.ends_with('.dll') { if !v.pref.out_name.ends_with('.dll') {
v.pref.out_name += '.dll' v.pref.out_name += '.dll'
@ -337,7 +343,7 @@ fn build_thirdparty_obj_file_with_msvc(path string, moduleflags []cflag.CFlag) {
// println('cfiles: $cfiles') // println('cfiles: $cfiles')
btarget := moduleflags.c_options_before_target_msvc() btarget := moduleflags.c_options_before_target_msvc()
atarget := moduleflags.c_options_after_target_msvc() atarget := moduleflags.c_options_after_target_msvc()
cmd := '"$msvc.full_cl_exe_path" /volatile:ms /Zi /DNDEBUG $include_string /c $btarget $cfiles $atarget /Fo"$obj_path"' cmd := '"$msvc.full_cl_exe_path" /volatile:ms /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 {