mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
strings: simplify Builder (#10263)
This commit is contained in:
@@ -102,6 +102,7 @@ pub mut:
|
||||
vexename string // v or v.exe
|
||||
vexepath string // the full absolute path to the prepared v/v.exe
|
||||
vvlocation string // v.v or compiler/ or cmd/v, depending on v version
|
||||
make_fresh_tcc bool // whether to do 'make fresh_tcc' before compiling an old V.
|
||||
}
|
||||
|
||||
pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() {
|
||||
@@ -141,6 +142,9 @@ pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() {
|
||||
}
|
||||
// Recompilation is needed. Just to be sure, clean up everything first.
|
||||
scripting.run('git clean -xf')
|
||||
if vgit_context.make_fresh_tcc {
|
||||
scripting.run('make fresh_tcc')
|
||||
}
|
||||
scripting.run(command_for_building_v_from_c_source)
|
||||
build_cmd := command_for_selfbuilding.replace('{SOURCE}', vgit_context.vvlocation)
|
||||
scripting.run(build_cmd)
|
||||
|
||||
@@ -39,6 +39,7 @@ mut:
|
||||
cc string = 'cc' // the C compiler to use for bootstrapping.
|
||||
cleanup bool // should the tool run a cleanup first
|
||||
use_cache bool // use local cached copies for --vrepo and --vcrepo in
|
||||
fresh_tcc bool // do use `make fresh_tcc`
|
||||
}
|
||||
|
||||
fn (mut c Context) compile_oldv_if_needed() {
|
||||
@@ -50,6 +51,7 @@ fn (mut c Context) compile_oldv_if_needed() {
|
||||
commit_v: c.commit_v
|
||||
path_v: c.path_v
|
||||
path_vc: c.path_vc
|
||||
make_fresh_tcc: c.fresh_tcc
|
||||
}
|
||||
c.vgcontext.compile_oldv_if_needed()
|
||||
c.commit_v_hash = c.vgcontext.commit_v__hash
|
||||
@@ -125,6 +127,7 @@ fn main() {
|
||||
}
|
||||
////
|
||||
context.cleanup = fp.bool('clean', 0, false, 'Clean before running (slower).')
|
||||
context.fresh_tcc = fp.bool('fresh_tcc', 0, true, 'Do `make fresh_tcc` when preparing a V compiler.')
|
||||
context.cmd_to_run = fp.string('command', `c`, '', 'Command to run in the old V repo.\n')
|
||||
commits := vgit.add_common_tool_options(mut context.vgo, mut fp)
|
||||
if should_sync {
|
||||
|
||||
Reference in New Issue
Block a user