Use absolute path to build.jai

This commit is contained in:
Michael Campagnaro 2023-06-03 16:22:13 -04:00
parent f19e84e1a5
commit 06bbc0c995

24
vimrc
View File

@ -1191,6 +1191,7 @@ function! Build(optimized=0, silent=0)
let l:ext = tolower(expand('%:e'))
let l:current_dir = expand('%:p:h')
let l:one_dir_back = expand('%:p:h:h')
let l:cmd = ""
@ -1199,15 +1200,16 @@ function! Build(optimized=0, silent=0)
" Check for a build file in the current directory or one directory back
" (e.g. we're in modules/ or src/, code/, etc)
if filereadable(l:current_dir . "/build.jai") || filereadable(l:current_dir . "/../build.jai")
if filereadable(l:current_dir . "/build.jai") || filereadable(l:one_dir_back . "/build.jai")
let l:has_jai_build_file = 1
let l:cmd = "jai " . l:current_dir . "/"
if filereadable(l:current_dir . "/build.jai") == 1
let l:cmd .= "build.jai"
let l:cmd = "jai ". l:current_dir . "/build.jai"
else
let l:cmd .= "../build.jai"
" It's one directory back. We don't want to include '../' in
" the cmd because then our reported paths in the program get
" botched, e.g. path shown in an assert error.
let l:cmd = "jai " . l:one_dir_back . "/build.jai"
endif
else
let l:cmd = "jai % "
@ -1227,12 +1229,12 @@ function! Build(optimized=0, silent=0)
if a:optimized == 1
echo "Compiling release build.jai"
" @note We pass 'release' as a user metaprogram arg for the
" build file to parse. -release is a compiler arg and we don't
" want to use that. Ideally the build script would ignore that
" completely. Also we don't bother adding an import directory
" for local modules because the build file should manage that
" sort of thing for us.
let l:cmd .= " - release"
" build file to parse in case it cares about that. -release is
" a compiler arg that we also include because some build
" scripts won't be looking at the user metaprogram args.
" We also don't bother adding an import directory for local modules
" because the build file should manage that sort of thing for us.
let l:cmd .= " -release - release"
let l:set_metaprogram_args = 1
else
echo "Compiling debug build.jai"