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

builder: cleanup commented cross compilation code in cc.v

This commit is contained in:
Delyan Angelov 2023-07-28 01:18:44 +03:00
parent d53d95991d
commit fe87d20f20
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -777,7 +777,7 @@ fn (mut b Builder) cc_linux_cross() {
verror(res.output) verror(res.output)
return return
} }
println(out_name + ' has been successfully compiled') println(out_name + ' has been successfully cross compiled for linux.')
} }
fn (mut c Builder) cc_windows_cross() { fn (mut c Builder) cc_windows_cross() {
@ -839,21 +839,6 @@ fn (mut c Builder) cc_windows_cross() {
} else { } else {
args << cflags.c_options_after_target() args << cflags.c_options_after_target()
} }
/*
winroot := '${pref.default_module_path}/winroot'
if !os.is_dir(winroot) {
winroot_url := 'https://github.com/vlang/v/releases/download/v0.1.10/winroot.zip'
println('"$winroot" not found.')
println('Download it from $winroot_url and save it in ${pref.default_module_path}')
println('Unzip it afterwards.\n')
println('winroot.zip contains all library and header files needed ' + 'to cross-compile for Windows.')
exit(1)
}
mut obj_name := c.out_name
obj_name = obj_name.replace('.exe', '')
obj_name = obj_name.replace('.o.o', '.o')
include := '-I $winroot/include '
*/
if os.user_os() !in ['macos', 'linux', 'termux'] { if os.user_os() !in ['macos', 'linux', 'termux'] {
println(os.user_os()) println(os.user_os())
panic('your platform is not supported yet') panic('your platform is not supported yet')
@ -883,20 +868,7 @@ fn (mut c Builder) cc_windows_cross() {
} }
exit(1) exit(1)
} }
/* println(c.pref.out_name + ' has been successfully cross compiled for windows.')
if c.pref.build_mode != .build_module {
link_cmd := 'lld-link $obj_name $winroot/lib/libcmt.lib ' + '$winroot/lib/libucrt.lib $winroot/lib/kernel32.lib $winroot/lib/libvcruntime.lib ' + '$winroot/lib/uuid.lib'
if c.pref.show_cc {
println(link_cmd)
}
if os.system(link_cmd) != 0 {
println('Cross compilation for Windows failed. Make sure you have lld linker installed.')
exit(1)
}
// os.rm(obj_name)
}
*/
println(c.pref.out_name + ' has been successfully compiled')
} }
fn (mut b Builder) build_thirdparty_obj_files() { fn (mut b Builder) build_thirdparty_obj_files() {