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

make gg work on Windows; prebuild glad and cJSON; new ft module

This commit is contained in:
Alexander Medvednikov
2019-07-10 13:27:35 +02:00
parent 06e7354d18
commit f834644db4
17 changed files with 6593 additions and 340 deletions

View File

@@ -40,6 +40,7 @@ fn new_cgen(out_name_c string) *CGen {
gen := &CGen {
out_path: path
out: out
lines: _make(0, 1000, sizeof(string))
}
return gen
}
@@ -220,3 +221,24 @@ fn (g mut CGen) add_to_main(s string) {
g.fn_main = g.fn_main + s
}
fn build_thirdparty_obj_file(flag string) {
obj_path := flag.all_after(' ')
if os.file_exists(obj_path) {
return
}
println('$obj_path not found, building it...')
parent := obj_path.all_before_last('/').trim_space()
files := os.ls(parent)
//files := os.ls(parent).filter(_.ends_with('.c')) TODO
mut cfiles := ''
for file in files {
if file.ends_with('.c') {
cfiles += parent + '/' + file + ' '
}
}
cc := if os.user_os() == 'windows' { 'gcc' } else { 'cc' } // TODO clang support on Windows
res := os.exec('$cc -c -o $obj_path $cfiles')
println(res)
}