mirror of
https://github.com/vlang/v.git
synced 2025-09-14 09:56:16 -04:00
v.builder: move filtering logic for -parallel-cc
to parallel_cc.v
This commit is contained in:
parent
5573667552
commit
570f84933c
@ -84,6 +84,7 @@ fn parallel_cc(mut b builder.Builder, result c.GenOutput) {
|
||||
}
|
||||
scompile_args := compile_args.join(' ')
|
||||
slinker_args := linker_args.join(' ')
|
||||
scompile_args_for_linker := compile_args.filter(it != '-x objective-c').join(' ')
|
||||
|
||||
mut o_postfixes := ['0', 'x']
|
||||
mut cmds := []string{}
|
||||
@ -100,7 +101,7 @@ fn parallel_cc(mut b builder.Builder, result c.GenOutput) {
|
||||
eprint_time(sw, 'C compilation on ${util.nr_jobs} thread(s), processing ${cmds.len} commands')
|
||||
|
||||
obj_files := fnames.map(it.replace('.c', '.o')).join(' ')
|
||||
link_cmd := '${cc} ${scompile_args} -o ${os.quoted_path(b.pref.out_name)} ${tmp_dir}/out_0.o ${obj_files} ${tmp_dir}/out_x.o ${slinker_args} ${cc_ldflags}'
|
||||
link_cmd := '${cc} ${scompile_args_for_linker} -o ${os.quoted_path(b.pref.out_name)} ${tmp_dir}/out_0.o ${obj_files} ${tmp_dir}/out_x.o ${slinker_args} ${cc_ldflags}'
|
||||
sw_link := time.new_stopwatch()
|
||||
link_res := os.execute(link_cmd)
|
||||
eprint_result_time(sw_link, 'link_cmd', link_cmd, link_res)
|
||||
|
@ -371,9 +371,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
|
||||
// macOS code can include objective C TODO remove once objective C is replaced with C
|
||||
if v.pref.os in [.macos, .ios] {
|
||||
if ccoptions.cc != .tcc && !user_darwin_ppc && !v.pref.is_bare && ccompiler != 'musl-gcc' {
|
||||
if !v.pref.parallel_cc {
|
||||
ccoptions.source_args << '-x objective-c'
|
||||
}
|
||||
ccoptions.source_args << '-x objective-c'
|
||||
}
|
||||
}
|
||||
// The C file we are compiling
|
||||
|
Loading…
x
Reference in New Issue
Block a user