mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builder: fix v builder error (#16590)
This commit is contained in:
parent
d8d75ee67e
commit
ffc73bf643
@ -981,3 +981,17 @@ fn error_context_lines(text string, keyword string, before int, after int) []str
|
||||
idx_e := if idx_s + after < lines.len { idx_s + after } else { lines.len }
|
||||
return lines[idx_s..idx_e]
|
||||
}
|
||||
|
||||
pub fn (mut v Builder) quote_compiler_name(name string) string {
|
||||
$if windows {
|
||||
// some compiler frontends on windows, like emcc, are a .bat file on windows.
|
||||
// Quoting the .bat file name here leads to problems with them, when they internally call python scripts for some reason.
|
||||
// Just emcc without quotes here does work, but:
|
||||
// |"emcc" -v| produces: python.exe: can't open file 'D:\programs\v\emcc.py': [Errno 2] No such file or directory
|
||||
if name.contains('/') || name.contains('\\') {
|
||||
return os.quoted_path(name)
|
||||
}
|
||||
return name
|
||||
}
|
||||
return os.quoted_path(name)
|
||||
}
|
||||
|
@ -6,17 +6,6 @@ module builder
|
||||
import os
|
||||
import v.pref
|
||||
|
||||
pub fn (mut v Builder) quote_compiler_name(name string) string {
|
||||
// some compiler frontends on windows, like emcc, are a .bat file on windows.
|
||||
// Quoting the .bat file name here leads to problems with them, when they internally call python scripts for some reason.
|
||||
// Just emcc without quotes here does work, but:
|
||||
// |"emcc" -v| produces: python.exe: can't open file 'D:\programs\v\emcc.py': [Errno 2] No such file or directory
|
||||
if name.contains('/') || name.contains('\\') {
|
||||
return os.quoted_path(name)
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
pub fn (mut v Builder) find_win_cc() ! {
|
||||
$if !windows {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user