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

cgen: add support for -g again

This commit is contained in:
Delyan Angelov
2020-08-12 00:08:19 +03:00
parent 6a8a589adb
commit ca7a64a451
6 changed files with 77 additions and 15 deletions

View File

@@ -141,3 +141,14 @@ pub fn verror(kind, s string) {
eprintln('$final_kind: $s')
exit(1)
}
pub fn vlines_escape_path(path string, ccompiler string) string {
is_cc_tcc := ccompiler.contains('tcc')
if is_cc_tcc {
// tcc currently has a bug, causing all #line files,
// to be prefixed with the *same folder as the .tmp.c file*
// this ../../ escaping, is a temporary workaround for that
return '../../../../../..' + cescaped_path(os.real_path(path))
}
return cescaped_path(os.real_path(path))
}