compiler: rename build to build_module

pull/1918/head
Vitor Oliveira 2019-09-10 07:36:14 -07:00 committed by Alexander Medvednikov
parent cd47f09f86
commit edd8528049
4 changed files with 9 additions and 9 deletions

View File

@ -40,7 +40,7 @@ fn (v mut V) cc() {
a << '-shared -fPIC '// -Wl,-z,defs' a << '-shared -fPIC '// -Wl,-z,defs'
v.out_name = v.out_name + '.so' v.out_name = v.out_name + '.so'
} }
if v.pref.build_mode == .build { if v.pref.build_mode == .build_module {
v.out_name = ModPath + v.dir + '.o' //v.out_name v.out_name = ModPath + v.dir + '.o' //v.out_name
println('Building ${v.out_name}...') println('Building ${v.out_name}...')
} }
@ -64,7 +64,7 @@ fn (v mut V) cc() {
} }
mut libs := ''// builtin.o os.o http.o etc mut libs := ''// builtin.o os.o http.o etc
if v.pref.build_mode == .build { if v.pref.build_mode == .build_module {
a << '-c' a << '-c'
} }
else if v.pref.build_mode == .embed_vlib { else if v.pref.build_mode == .embed_vlib {

View File

@ -108,7 +108,7 @@ fn (f mut Fn) clear_vars() {
// vlib header file? // vlib header file?
fn (p mut Parser) is_sig() bool { fn (p mut Parser) is_sig() bool {
return (p.pref.build_mode == .default_mode || p.pref.build_mode == .build) && return (p.pref.build_mode == .default_mode || p.pref.build_mode == .build_module) &&
(p.file_path.contains(ModPath)) (p.file_path.contains(ModPath))
} }

View File

@ -23,7 +23,7 @@ enum BuildMode {
embed_vlib embed_vlib
// `v -lib ~/v/os` // `v -lib ~/v/os`
// build any module (generate os.o + os.vh) // build any module (generate os.o + os.vh)
build //TODO a better name would be smth like `.build_module` I think build_module
} }
const ( const (
@ -238,7 +238,7 @@ fn (v mut V) compile() {
imports_json := v.table.imports.contains('json') imports_json := v.table.imports.contains('json')
// TODO remove global UI hack // TODO remove global UI hack
if v.os == .mac && ((v.pref.build_mode == .embed_vlib && v.table.imports.contains('ui')) || if v.os == .mac && ((v.pref.build_mode == .embed_vlib && v.table.imports.contains('ui')) ||
(v.pref.build_mode == .build && v.dir.contains('/ui'))) { (v.pref.build_mode == .build_module && v.dir.contains('/ui'))) {
cgen.genln('id defaultFont = 0; // main.v') cgen.genln('id defaultFont = 0; // main.v')
} }
// We need the cjson header for all the json decoding user will do in default mode // We need the cjson header for all the json decoding user will do in default mode
@ -576,7 +576,7 @@ fn (v mut V) add_v_files_to_compile() {
// TmpPath/vlib // TmpPath/vlib
// These were generated by vfmt // These were generated by vfmt
/* /*
if v.pref.build_mode == .default_mode || v.pref.build_mode == .build { if v.pref.build_mode == .default_mode || v.pref.build_mode == .build_module {
module_path = '$ModPath/vlib/$mod_p' module_path = '$ModPath/vlib/$mod_p'
} }
*/ */
@ -600,7 +600,7 @@ fn (v mut V) add_v_files_to_compile() {
} }
j++ j++
// TODO remove this once imports work with .build // TODO remove this once imports work with .build
if v.pref.build_mode == .build && j >= len / 2{ if v.pref.build_mode == .build_module && j >= len / 2{
break break
} }
//println(fit) //println(fit)
@ -770,7 +770,7 @@ fn new_v(args[]string) &V {
for builtin in builtins { for builtin in builtins {
mut f := '$vroot/vlib/builtin/$builtin' mut f := '$vroot/vlib/builtin/$builtin'
// In default mode we use precompiled vlib.o, point to .vh files with signatures // In default mode we use precompiled vlib.o, point to .vh files with signatures
if build_mode == .default_mode || build_mode == .build { if build_mode == .default_mode || build_mode == .build_module {
//f = '$TmpPath/vlib/builtin/${builtin}h' //f = '$TmpPath/vlib/builtin/${builtin}h'
} }
files << f files << f

View File

@ -249,7 +249,7 @@ pub fn (v mut V) cc_msvc() {
v.out_name = os.realpath( v.out_name ) v.out_name = os.realpath( v.out_name )
mut alibs := []string // builtin.o os.o http.o etc mut alibs := []string // builtin.o os.o http.o etc
if v.pref.build_mode == .build { if v.pref.build_mode == .build_module {
} }
else if v.pref.build_mode == .embed_vlib { else if v.pref.build_mode == .embed_vlib {
// //