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

compiler: v.v fixes

This commit is contained in:
Alexander Medvednikov 2019-10-14 05:18:48 +03:00
parent 387e56e215
commit e2bca190a9
3 changed files with 6 additions and 6 deletions

1
v.v
View File

@ -92,3 +92,4 @@ fn main() {
v.finalize_compilation() v.finalize_compilation()
} }

View File

@ -496,9 +496,9 @@ pub fn (v V) run_compiled_executable_and_exit() {
pub fn (v &V) v_files_from_dir(dir string) []string { pub fn (v &V) v_files_from_dir(dir string) []string {
mut res := []string mut res := []string
if !os.file_exists(dir) { if !os.file_exists(dir) {
verror('$dir doesn\'t exist') verror("$dir doesn't exist!")
} else if !os.dir_exists(dir) { } else if !os.dir_exists(dir) {
verror('$dir isn\'t a directory') verror("$dir isn't a directory")
} }
mut files := os.ls(dir) mut files := os.ls(dir)
if v.pref.is_verbose { if v.pref.is_verbose {
@ -600,7 +600,6 @@ pub fn (v mut V) add_v_files_to_compile() {
pub fn (v &V) get_builtin_files() []string { pub fn (v &V) get_builtin_files() []string {
// .vh cache exists? Use it // .vh cache exists? Use it
$if js { $if js {
return v.v_files_from_dir('$v.vroot${os.path_separator}vlib${os.path_separator}builtin${os.path_separator}js') return v.v_files_from_dir('$v.vroot${os.path_separator}vlib${os.path_separator}builtin${os.path_separator}js')
} }

View File

@ -131,13 +131,13 @@ pub fn v_test_v(args_before_test string){
println('vlib/ is missing, it must be next to the V executable') println('vlib/ is missing, it must be next to the V executable')
exit(1) exit(1)
} }
if !os.dir_exists(parent_dir + '/compiler') { if !os.file_exists(parent_dir + '/v.v') {
println('compiler/ is missing, it must be next to the V executable') println('v.v is missing, it must be next to the V executable')
exit(1) exit(1)
} }
// Make sure v.c can be compiled without warnings // Make sure v.c can be compiled without warnings
$if mac { $if mac {
os.system('$vexe -o v.c compiler') os.system('$vexe -o v.c v.v')
if os.system('cc -Werror v.c') != 0 { if os.system('cc -Werror v.c') != 0 {
println('cc failed to build v.c without warnings') println('cc failed to build v.c without warnings')
exit(1) exit(1)