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

filepath: path separator (#3756)

This commit is contained in:
yuyi
2020-02-18 03:31:23 +08:00
committed by GitHub
parent 6079025985
commit 6849a4e770
26 changed files with 105 additions and 99 deletions

View File

@ -681,8 +681,8 @@ pub fn (v mut V) add_v_files_to_compile() {
}
// use cached built module if exists
if v.pref.vpath != '' && v.pref.build_mode != .build_module && !mod.contains('vweb') {
mod_path := mod.replace('.', os.path_separator)
vh_path := '$v_modules_path${os.path_separator}vlib${os.path_separator}${mod_path}.vh'
mod_path := mod.replace('.', filepath.separator)
vh_path := '$v_modules_path${filepath.separator}vlib${filepath.separator}${mod_path}.vh'
if v.pref.is_cache && os.exists(vh_path) {
eprintln('using cached module `$mod`: $vh_path')
v.cached_mods << mod
@ -924,5 +924,5 @@ pub fn set_vroot_folder(vroot_path string) {
// VEXE env variable is needed so that compiler.vexe_path()
// can return it later to whoever needs it:
vname := if os.user_os() == 'windows' { 'v.exe' } else { 'v' }
os.setenv('VEXE', os.realpath([vroot_path, vname].join(os.path_separator)), true)
os.setenv('VEXE', os.realpath([vroot_path, vname].join(filepath.separator)), true)
}