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

cmd/v: rewrite flags

This commit is contained in:
lutherwenxu
2020-03-07 01:53:29 +08:00
committed by GitHub
parent 522de0871a
commit aab31f4b35
37 changed files with 1087 additions and 464 deletions

View File

@@ -17,7 +17,7 @@ fn todo() {
fn (v &V) no_cc_installed() bool {
$if windows {
os.exec('$v.pref.ccompiler -v')or{
if v.pref.is_verbose {
if v.pref.verbosity.is_higher_or_equal(.level_one) {
println('C compiler not found, trying to build with msvc...')
}
return true
@@ -328,7 +328,7 @@ start:
// TODO remove
cmd := '${v.pref.ccompiler} $args'
// Run
if v.pref.show_c_cmd || v.pref.is_verbose {
if v.pref.verbosity.is_higher_or_equal(.level_one) {
println('\n==========')
println(cmd)
}
@@ -402,7 +402,7 @@ If you're confident that all of the above is true, please try running V with the
}
diff := time.ticks() - ticks
// Print the C command
if v.pref.show_c_cmd || v.pref.is_verbose {
if v.pref.verbosity.is_higher_or_equal(.level_one) {
println('${v.pref.ccompiler} took $diff ms')
println('=========\n')
}
@@ -513,7 +513,7 @@ fn (c mut V) cc_windows_cross() {
println(cmd)
//cmd := 'clang -o $obj_name -w $include -m32 -c -target x86_64-win32 $v_modules_path/$c.out_name_c'
if c.pref.show_c_cmd {
if c.pref.verbosity.is_higher_or_equal(.level_one) {
println(cmd)
}
if os.system(cmd) != 0 {