@@ -119,7 +119,7 @@ impl Session {
119119 pub fn new < I > (
120120 inputs : I ,
121121 output_dir : Option < PathBuf > ,
122- output_file : Option < OutputFile > ,
122+ output_files : Option < Vec < OutputFile > > ,
123123 target_dir : PathBuf ,
124124 options : Options ,
125125 emitter : Option < Arc < dyn Emitter > > ,
@@ -130,13 +130,13 @@ impl Session {
130130 {
131131 let inputs = inputs. into_iter ( ) . collect :: < Vec < _ > > ( ) ;
132132
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)
134134 }
135135
136136 fn make (
137137 inputs : Vec < InputFile > ,
138138 output_dir : Option < PathBuf > ,
139- output_file : Option < OutputFile > ,
139+ output_files : Option < Vec < OutputFile > > ,
140140 target_dir : PathBuf ,
141141 options : Options ,
142142 emitter : Option < Arc < dyn Emitter > > ,
@@ -156,9 +156,20 @@ impl Session {
156156 . unwrap_or( "<unset>" . to_string( ) )
157157 ) ;
158158 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( e. as_str( ) ) ;
168+ acc
169+ } )
170+ . unwrap_or( "<unset>" . to_string( ) )
171+ } )
172+ . unwrap_or( "<unset>" . to_string( ) )
162173 ) ;
163174 log:: debug!( target: "driver" , " | target_dir = {}" , target_dir. display( ) ) ;
164175 }
@@ -168,6 +179,11 @@ impl Session {
168179 emitter. unwrap_or_else ( || options. default_emitter ( ) ) ,
169180 ) ) ;
170181
182+ let output_file: Option < OutputFile > = if let Some ( output_files) = output_files {
183+ output_files. into_iter ( ) . filter ( |of| of. parent ( ) . is_some ( ) ) . reduce ( |acc, _| acc)
184+ } else {
185+ None
186+ } ;
171187 let output_dir = output_dir
172188 . as_deref ( )
173189 . or_else ( || output_file. as_ref ( ) . and_then ( |of| of. parent ( ) ) )
0 commit comments