@@ -119,7 +119,7 @@ impl Session {
119
119
pub fn new < I > (
120
120
inputs : I ,
121
121
output_dir : Option < PathBuf > ,
122
- output_file : Option < OutputFile > ,
122
+ output_files : Option < Vec < OutputFile > > ,
123
123
target_dir : PathBuf ,
124
124
options : Options ,
125
125
emitter : Option < Arc < dyn Emitter > > ,
@@ -130,13 +130,13 @@ impl Session {
130
130
{
131
131
let inputs = inputs. into_iter ( ) . collect :: < Vec < _ > > ( ) ;
132
132
133
- Self :: make ( inputs, output_dir, output_file , target_dir, options, emitter, source_manager)
133
+ Self :: make ( inputs, output_dir, output_files , target_dir, options, emitter, source_manager)
134
134
}
135
135
136
136
fn make (
137
137
inputs : Vec < InputFile > ,
138
138
output_dir : Option < PathBuf > ,
139
- output_file : Option < OutputFile > ,
139
+ output_files : Option < Vec < OutputFile > > ,
140
140
target_dir : PathBuf ,
141
141
options : Options ,
142
142
emitter : Option < Arc < dyn Emitter > > ,
@@ -156,9 +156,21 @@ impl Session {
156
156
. unwrap_or( "<unset>" . to_string( ) )
157
157
) ;
158
158
log:: debug!(
159
- target: "driver" ,
160
- " | output_file = {}" ,
161
- output_file. as_ref( ) . map( |of| of. to_string( ) ) . unwrap_or( "<unset>" . to_string( ) )
159
+ target: "driver" ,
160
+ " | output_files = {}" ,
161
+ output_files. as_ref( )
162
+ . map( |output_files| {
163
+ output_files
164
+ . iter( )
165
+ . map( |of| of. to_string( ) )
166
+ . reduce( |mut acc, e| {
167
+ acc. push_str( ", " ) ;
168
+ acc. push_str( e. as_str( ) ) ;
169
+ acc
170
+ } )
171
+ . unwrap_or( "<unset>" . to_string( ) )
172
+ } )
173
+ . unwrap_or( "<unset>" . to_string( ) )
162
174
) ;
163
175
log:: debug!( target: "driver" , " | target_dir = {}" , target_dir. display( ) ) ;
164
176
}
@@ -168,6 +180,11 @@ impl Session {
168
180
emitter. unwrap_or_else ( || options. default_emitter ( ) ) ,
169
181
) ) ;
170
182
183
+ let output_file: Option < OutputFile > = if let Some ( output_files) = output_files {
184
+ output_files. into_iter ( ) . filter ( |of| of. parent ( ) . is_some ( ) ) . reduce ( |acc, _| acc)
185
+ } else {
186
+ None
187
+ } ;
171
188
let output_dir = output_dir
172
189
. as_deref ( )
173
190
. or_else ( || output_file. as_ref ( ) . and_then ( |of| of. parent ( ) ) )
0 commit comments