builder: fix support for tcc on windows (openlibm.o)

pull/6678/head
Delyan Angelov 2020-10-25 03:35:28 +03:00
parent 4653ed3fa5
commit 5cb31c2c8f
1 changed files with 8 additions and 0 deletions

View File

@ -785,6 +785,14 @@ fn (mut v Builder) build_thirdparty_obj_file(path string, moduleflags []cflag.CF
if os.exists(opath) {
return
}
if os.exists(obj_path) {
// Some .o files are distributed with no source
// for example thirdparty\tcc\lib\openlibm.o
// the best we can do for them is just copy them,
// and hope that they work with any compiler...
os.cp(obj_path, opath)
return
}
println('$obj_path not found, building it in $opath ...')
cfile := '${path[..path.len - 2]}.c'
btarget := moduleflags.c_options_before_target()