mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builder: bring back cross compilation for windows
This commit is contained in:
parent
1bf26a35fa
commit
e60e8f3b34
@ -490,8 +490,6 @@ If you're confident that all of the above is true, please try running V with the
|
||||
}
|
||||
|
||||
fn (mut c Builder) cc_windows_cross() {
|
||||
/*
|
||||
QTODO
|
||||
println('Cross compiling for Windows...')
|
||||
if !c.pref.out_name.ends_with('.exe') {
|
||||
c.pref.out_name += '.exe'
|
||||
@ -530,22 +528,24 @@ fn (mut c Builder) cc_windows_cross() {
|
||||
obj_name = obj_name.replace('.o.o', '.o')
|
||||
include := '-I $winroot/include '
|
||||
*/
|
||||
mut cmd := ''
|
||||
cmd = ''
|
||||
$if macos {
|
||||
cmd = 'x86_64-w64-mingw32-gcc -std=gnu11 $args -municode'
|
||||
}
|
||||
$else {
|
||||
if os.user_os() !in ['mac', 'darwin','linux'] {
|
||||
println(os.user_os())
|
||||
panic('your platform is not supported yet')
|
||||
}
|
||||
|
||||
println(cmd)
|
||||
mut cmd := 'x86_64-w64-mingw32-gcc'
|
||||
cmd += ' -std=gnu11 $args -municode'
|
||||
//cmd := 'clang -o $obj_name -w $include -m32 -c -target x86_64-win32 ${pref.default_module_path}/$c.out_name_c'
|
||||
if c.pref.verbosity.is_higher_or_equal(.level_one) {
|
||||
if c.pref.is_verbose {
|
||||
println(cmd)
|
||||
}
|
||||
if os.system(cmd) != 0 {
|
||||
println('Cross compilation for Windows failed. Make sure you have clang installed.')
|
||||
println('Cross compilation for Windows failed. Make sure you have mingw-w64 installed.')
|
||||
$if macos {
|
||||
println('brew install mingw-w64')
|
||||
}
|
||||
$if linux {
|
||||
println('sudo apt install -y mingw-w64')
|
||||
}
|
||||
exit(1)
|
||||
}
|
||||
/*
|
||||
@ -561,8 +561,7 @@ fn (mut c Builder) cc_windows_cross() {
|
||||
// os.rm(obj_name)
|
||||
}
|
||||
*/
|
||||
println('Done!')
|
||||
*/
|
||||
println(c.pref.out_name + ' has been successfully compiled')
|
||||
}
|
||||
|
||||
fn (c &Builder) build_thirdparty_obj_files() {
|
||||
|
Loading…
Reference in New Issue
Block a user