From edd852804920197d55f288567af5499b3d86e8f1 Mon Sep 17 00:00:00 2001 From: Vitor Oliveira Date: Tue, 10 Sep 2019 07:36:14 -0700 Subject: [PATCH] compiler: rename build to build_module --- compiler/cc.v | 4 ++-- compiler/fn.v | 2 +- compiler/main.v | 10 +++++----- compiler/msvc.v | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/cc.v b/compiler/cc.v index 185f7e2eac..8a3f9653db 100644 --- a/compiler/cc.v +++ b/compiler/cc.v @@ -40,7 +40,7 @@ fn (v mut V) cc() { a << '-shared -fPIC '// -Wl,-z,defs' 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 println('Building ${v.out_name}...') } @@ -64,7 +64,7 @@ fn (v mut V) cc() { } mut libs := ''// builtin.o os.o http.o etc - if v.pref.build_mode == .build { + if v.pref.build_mode == .build_module { a << '-c' } else if v.pref.build_mode == .embed_vlib { diff --git a/compiler/fn.v b/compiler/fn.v index 6ebd083c49..134d5b554a 100644 --- a/compiler/fn.v +++ b/compiler/fn.v @@ -108,7 +108,7 @@ fn (f mut Fn) clear_vars() { // vlib header file? 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)) } diff --git a/compiler/main.v b/compiler/main.v index a43f839115..e1b482c9aa 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -23,7 +23,7 @@ enum BuildMode { embed_vlib // `v -lib ~/v/os` // build any module (generate os.o + os.vh) - build //TODO a better name would be smth like `.build_module` I think + build_module } const ( @@ -238,7 +238,7 @@ fn (v mut V) compile() { imports_json := v.table.imports.contains('json') // TODO remove global UI hack 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') } // 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 // 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' } */ @@ -600,7 +600,7 @@ fn (v mut V) add_v_files_to_compile() { } j++ // 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 } //println(fit) @@ -770,7 +770,7 @@ fn new_v(args[]string) &V { for builtin in builtins { mut f := '$vroot/vlib/builtin/$builtin' // 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' } files << f diff --git a/compiler/msvc.v b/compiler/msvc.v index 0d82d73631..84393dc020 100644 --- a/compiler/msvc.v +++ b/compiler/msvc.v @@ -249,7 +249,7 @@ pub fn (v mut V) cc_msvc() { v.out_name = os.realpath( v.out_name ) 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 { //