From fb0817277f27655c04cb83d58ca71532bf137980 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 7 Jan 2020 16:42:14 +0200 Subject: [PATCH] compiler: force .exe extension, when compiling on windows --- vlib/compiler/cc.v | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vlib/compiler/cc.v b/vlib/compiler/cc.v index 6af59d65bf..1c0c870d63 100644 --- a/vlib/compiler/cc.v +++ b/vlib/compiler/cc.v @@ -118,6 +118,15 @@ fn (v mut V) cc() { verror('-fast is only supported on Linux right now') } } + + if !v.pref.is_so + && v.pref.build_mode != .build_module + && os.user_os() == 'windows' + && !v.out_name.ends_with('.exe') + { + v.out_name += '.exe' + } + // linux_host := os.user_os() == 'linux' v.log('cc() isprod=$v.pref.is_prod outname=$v.out_name') if v.pref.is_so {