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

v fmt: process .v files from a module too

This commit is contained in:
Delyan Angelov
2019-12-24 04:43:31 +02:00
committed by Alexander Medvednikov
parent 411a83e283
commit 96fa15c125
7 changed files with 258 additions and 119 deletions

View File

@ -5,6 +5,7 @@ module compiler
import (
os
os.cmdline
time
filepath
)
@ -467,9 +468,9 @@ fn (c &V) build_thirdparty_obj_files() {
}
fn find_c_compiler() string {
args := env_vflags_and_os_args().join(' ')
args := env_vflags_and_os_args()
defaultcc := find_c_compiler_default()
return get_arg(args, 'cc', defaultcc)
return cmdline.option(args, '-cc', defaultcc)
}
fn find_c_compiler_default() string {
@ -486,7 +487,7 @@ fn find_c_compiler_default() string {
fn find_c_compiler_thirdparty_options() string {
fullargs := env_vflags_and_os_args()
mut cflags := get_cmdline_multiple_values(fullargs,'-cflags')
mut cflags := cmdline.many_values(fullargs,'-cflags')
$if !windows {
cflags << '-fPIC'
}
@ -496,16 +497,6 @@ fn find_c_compiler_thirdparty_options() string {
return cflags.join(' ')
}
fn get_cmdline_multiple_values(args []string, optname string) []string {
mut flags := []string
for ci, cv in args {
if cv == optname {
flags << args[ci + 1]
}
}
return flags
}
fn parse_defines(defines []string) ([]string,[]string) {
// '-d abc -d xyz=1 -d qwe=0' should produce:
// compile_defines: ['abc','xyz']