builder: cleanup cc.v; log build_thirdparty_obj_files with `-v`
parent
d663f57d43
commit
88f75fc1d6
|
@ -211,7 +211,7 @@ fn (mut v Builder) cc() {
|
||||||
}
|
}
|
||||||
if v.pref.build_mode == .build_module {
|
if v.pref.build_mode == .build_module {
|
||||||
// Create the modules & out directory if it's not there.
|
// Create the modules & out directory if it's not there.
|
||||||
mut out_dir := if v.pref.path.starts_with('vlib') { '$pref.default_module_path${os.path_separator}cache$os.path_separator$v.pref.path' } else { '$pref.default_module_path${os.path_separator}cache/$v.pref.path' }
|
out_dir := os.join_path(pref.default_module_path, 'cache', v.pref.path)
|
||||||
pdir := out_dir.all_before_last(os.path_separator)
|
pdir := out_dir.all_before_last(os.path_separator)
|
||||||
if !os.is_dir(pdir) {
|
if !os.is_dir(pdir) {
|
||||||
os.mkdir_all(pdir)
|
os.mkdir_all(pdir)
|
||||||
|
@ -299,7 +299,7 @@ fn (mut v Builder) cc() {
|
||||||
args << '-c'
|
args << '-c'
|
||||||
} else if v.pref.use_cache {
|
} else if v.pref.use_cache {
|
||||||
mut built_modules := []string{}
|
mut built_modules := []string{}
|
||||||
builtin_obj_path := pref.default_module_path + os.path_separator + 'cache' + os.path_separator + 'vlib' + os.path_separator + 'builtin.o'
|
builtin_obj_path := os.join_path(pref.default_module_path, 'cache', 'vlib', 'builtin.o')
|
||||||
if !os.exists(builtin_obj_path) {
|
if !os.exists(builtin_obj_path) {
|
||||||
os.system('$vexe build-module vlib/builtin')
|
os.system('$vexe build-module vlib/builtin')
|
||||||
}
|
}
|
||||||
|
@ -333,10 +333,9 @@ fn (mut v Builder) cc() {
|
||||||
// if os.is_dir(af_base_dir + os.path_separator + mod_path) {
|
// if os.is_dir(af_base_dir + os.path_separator + mod_path) {
|
||||||
// continue
|
// continue
|
||||||
// }
|
// }
|
||||||
|
imp_path := os.join_path('vlib', mod_path)
|
||||||
imp_path := 'vlib' + os.path_separator + mod_path
|
cache_path := os.join_path(pref.default_module_path, 'cache')
|
||||||
cache_path := pref.default_module_path + os.path_separator + 'cache'
|
obj_path := os.join_path(cache_path, '${imp_path}.o')
|
||||||
obj_path := cache_path + os.path_separator + '${imp_path}.o'
|
|
||||||
if os.exists(obj_path) {
|
if os.exists(obj_path) {
|
||||||
libs += ' ' + obj_path
|
libs += ' ' + obj_path
|
||||||
} else {
|
} else {
|
||||||
|
@ -722,14 +721,15 @@ fn (mut c Builder) cc_windows_cross() {
|
||||||
println(c.pref.out_name + ' has been successfully compiled')
|
println(c.pref.out_name + ' has been successfully compiled')
|
||||||
}
|
}
|
||||||
|
|
||||||
fn (mut c Builder) build_thirdparty_obj_files() {
|
fn (mut v Builder) build_thirdparty_obj_files() {
|
||||||
for flag in c.get_os_cflags() {
|
v.log('build_thirdparty_obj_files: v.table.cflags: $v.table.cflags')
|
||||||
|
for flag in v.get_os_cflags() {
|
||||||
if flag.value.ends_with('.o') {
|
if flag.value.ends_with('.o') {
|
||||||
rest_of_module_flags := c.get_rest_of_module_cflags(flag)
|
rest_of_module_flags := v.get_rest_of_module_cflags(flag)
|
||||||
if c.pref.ccompiler == 'msvc' {
|
if v.pref.ccompiler == 'msvc' {
|
||||||
c.build_thirdparty_obj_file_with_msvc(flag.value, rest_of_module_flags)
|
v.build_thirdparty_obj_file_with_msvc(flag.value, rest_of_module_flags)
|
||||||
} else {
|
} else {
|
||||||
c.build_thirdparty_obj_file(flag.value, rest_of_module_flags)
|
v.build_thirdparty_obj_file(flag.value, rest_of_module_flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue