mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
@@ -750,7 +750,13 @@ fn (mut b Builder) cc_linux_cross() {
|
|||||||
cc_args << '-c "$b.out_name_c"'
|
cc_args << '-c "$b.out_name_c"'
|
||||||
cc_args << libs
|
cc_args << libs
|
||||||
b.dump_c_options(cc_args)
|
b.dump_c_options(cc_args)
|
||||||
cc_cmd := '${os.quoted_path('cc')} ' + cc_args.join(' ')
|
mut cc_name := 'cc'
|
||||||
|
mut out_name := b.pref.out_name
|
||||||
|
$if windows {
|
||||||
|
cc_name = 'clang.exe'
|
||||||
|
out_name = out_name.trim_string_right('.exe')
|
||||||
|
}
|
||||||
|
cc_cmd := '${os.quoted_path(cc_name)} ' + cc_args.join(' ')
|
||||||
if b.pref.show_cc {
|
if b.pref.show_cc {
|
||||||
println(cc_cmd)
|
println(cc_cmd)
|
||||||
}
|
}
|
||||||
@@ -761,14 +767,17 @@ fn (mut b Builder) cc_linux_cross() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
mut linker_args := ['-L$sysroot/usr/lib/x86_64-linux-gnu/', '-L$sysroot/lib/x86_64-linux-gnu',
|
mut linker_args := ['-L$sysroot/usr/lib/x86_64-linux-gnu/', '-L$sysroot/lib/x86_64-linux-gnu',
|
||||||
'--sysroot=$sysroot', '-v', '-o $b.pref.out_name', '-m elf_x86_64',
|
'--sysroot=$sysroot', '-v', '-o $out_name', '-m elf_x86_64',
|
||||||
'-dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2',
|
'-dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2',
|
||||||
'$sysroot/crt1.o $sysroot/crti.o $obj_file', '-lc', '-lcrypto', '-lssl', '-lpthread',
|
'$sysroot/crt1.o $sysroot/crti.o $obj_file', '-lc', '-lcrypto', '-lssl', '-lpthread',
|
||||||
'$sysroot/crtn.o', '-lm']
|
'$sysroot/crtn.o', '-lm']
|
||||||
linker_args << cflags.c_options_only_object_files()
|
linker_args << cflags.c_options_only_object_files()
|
||||||
// -ldl
|
// -ldl
|
||||||
b.dump_c_options(linker_args)
|
b.dump_c_options(linker_args)
|
||||||
ldlld := '$sysroot/ld.lld'
|
mut ldlld := '$sysroot/ld.lld'
|
||||||
|
$if windows {
|
||||||
|
ldlld = 'ld.lld.exe'
|
||||||
|
}
|
||||||
linker_cmd := '${os.quoted_path(ldlld)} ' + linker_args.join(' ')
|
linker_cmd := '${os.quoted_path(ldlld)} ' + linker_args.join(' ')
|
||||||
// s = s.replace('SYSROOT', sysroot) // TODO $ inter bug
|
// s = s.replace('SYSROOT', sysroot) // TODO $ inter bug
|
||||||
// s = s.replace('-o hi', '-o ' + c.pref.out_name)
|
// s = s.replace('-o hi', '-o ' + c.pref.out_name)
|
||||||
@@ -781,7 +790,7 @@ fn (mut b Builder) cc_linux_cross() {
|
|||||||
verror(res.output)
|
verror(res.output)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
println(b.pref.out_name + ' has been successfully compiled')
|
println(out_name + ' has been successfully compiled')
|
||||||
}
|
}
|
||||||
|
|
||||||
fn (mut c Builder) cc_windows_cross() {
|
fn (mut c Builder) cc_windows_cross() {
|
||||||
|
Reference in New Issue
Block a user