v.util, v.builder: fix util.module_is_builtin on macos with -usecache

master
Delyan Angelov 2022-05-31 09:30:45 +03:00
parent 4ffdcf8058
commit dc30089c74
2 changed files with 2 additions and 6 deletions

View File

@ -211,7 +211,7 @@ fn (mut b Builder) handle_usecache(vexe string) {
// strconv is already imported inside builtin, so skip generating its object file // strconv is already imported inside builtin, so skip generating its object file
// TODO: incase we have other modules with the same name, make sure they are vlib // TODO: incase we have other modules with the same name, make sure they are vlib
// is this even doign anything? // is this even doign anything?
if imp in ['strconv', 'strings', 'dlmalloc'] { if util.module_is_builtin(imp) {
continue continue
} }
if imp in built_modules { if imp in built_modules {

View File

@ -37,12 +37,8 @@ const (
] ]
) )
const builtin_module_names = ['builtin', 'strconv', 'strings', 'dlmalloc', 'math']
pub fn module_is_builtin(mod string) bool { pub fn module_is_builtin(mod string) bool {
// NOTE: using util.builtin_module_parts here breaks -usecache on macos return mod in util.builtin_module_parts
return mod in util.builtin_module_names
// return mod in util.builtin_module_parts
} }
pub fn tabs(n int) string { pub fn tabs(n int) string {