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

compiler: add -vpath and -vlib_path options

This commit is contained in:
gabixdev
2019-11-21 13:06:19 +01:00
committed by Alexander Medvednikov
parent 00365b082f
commit 76cd70c232
3 changed files with 37 additions and 14 deletions

View File

@ -159,12 +159,12 @@ fn (v &V) find_module_path(mod string) ?string {
mut import_path := os.getwd() + '${os.path_separator}$mod_path'
// Now search in vlib/
if mod == 'compiler' || !os.dir_exists(import_path) {
import_path = '$v.lang_dir${os.path_separator}vlib${os.path_separator}$mod_path'
import_path = '${v.pref.vlib_path}${os.path_separator}$mod_path'
}
//println('ip=$import_path')
// Finally try modules installed with vpm (~/.vmodules)
if !os.dir_exists(import_path) {
import_path = '$v_modules_path${os.path_separator}$mod_path'
import_path = '${v.pref.vpath}${os.path_separator}$mod_path'
if !os.dir_exists(import_path){
return error('module "$mod" not found')
}