File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -377,7 +377,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
377377 }
378378 }
379379 if v.pref.os == .windows {
380- ccoptions.post_args << '-municode'
380+ ccoptions.post_args << v. get_subsystem_flag ()
381381 }
382382 cflags := v.get_os_cflags ()
383383
@@ -811,6 +811,14 @@ fn (mut b Builder) ensure_freebsdroot_exists(sysroot string) {
811811 }
812812}
813813
814+ fn (mut b Builder) get_subsystem_flag () string {
815+ return match b.pref.subsystem {
816+ .auto { '-municode' }
817+ .console { '-municode -mconsole' }
818+ .windows { '-municode -mwindows' }
819+ }
820+ }
821+
814822fn (mut b Builder) cc_linux_cross () {
815823 b.setup_ccompiler_options (b.pref.ccompiler)
816824 b.build_thirdparty_obj_files ()
@@ -1014,8 +1022,7 @@ fn (mut c Builder) cc_windows_cross() {
10141022 all_args << debug_options
10151023
10161024 all_args << args
1017-
1018- all_args << '-municode'
1025+ all_args << c.get_subsystem_flag ()
10191026 all_args << c.ccoptions.linker_flags
10201027 all_args << '${c.pref.ldflags} '
10211028 c.dump_c_options (all_args)
You can’t perform that action at this time.
0 commit comments