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

tools: simplify gen_vc.v

This commit is contained in:
Delyan Angelov 2021-04-18 08:55:27 +03:00
parent a761f6888f
commit eaf930aa8b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -278,9 +278,8 @@ fn (mut gen_vc GenVC) generate() {
gen_vc.assert_file_exists_and_is_not_too_short(v_exec, err_msg_make)
// build v.c for each os
for os_name in vc_build_oses {
vc_suffix := if os_name == 'nix' { '' } else { '_${os_name[..3]}' }
c_file := if os_name == 'nix' { 'v.c' } else { 'v_win.c' }
v_flags := if os_name == 'nix' { '-os cross' } else { '-os $os_name' }
c_file := 'v${vc_suffix}.c'
// try generate .c file
gen_vc.cmd_exec('$v_exec $v_flags -o $c_file $git_repo_dir_v/cmd/v')
// check if the c file seems ok