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

native: append .exe, when using the native backend on windows (#12159)

This commit is contained in:
pancake 2021-10-12 17:49:42 +02:00 committed by GitHub
parent a0a0ae85eb
commit 347ebe5fd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,10 +74,15 @@ fn get_backend(arch pref.Arch) ?CodeGen {
}
pub fn gen(files []&ast.File, table &ast.Table, out_name string, pref &pref.Preferences) (int, int) {
exe_name := if pref.os == .windows && !out_name.ends_with('.exe') {
out_name + '.exe'
} else {
out_name
}
mut g := &Gen{
table: table
sect_header_name_pos: 0
out_name: out_name
out_name: exe_name
pref: pref
// TODO: workaround, needs to support recursive init
code_gen: get_backend(pref.arch) or {