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:

committed by
Alexander Medvednikov

parent
00365b082f
commit
76cd70c232
@ -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')
|
||||
}
|
||||
|
Reference in New Issue
Block a user