@@ -280,6 +280,10 @@ struct ComponentLdArgs {
280280 /// only used when one or more `--component-type` options are specified.
281281 #[ clap( long, value_parser = parse_encoding, default_value = "utf8" ) ]
282282 string_encoding : StringEncoding ,
283+
284+ /// Skip the `wit-component`-based process to generate a component.
285+ #[ clap( long) ]
286+ skip_wit_component : bool ,
283287}
284288
285289fn parse_adapter ( s : & str ) -> Result < ( String , Vec < u8 > ) > {
@@ -525,7 +529,7 @@ impl App {
525529 // output directly at the desired output location. Otherwise output to a
526530 // temporary location for wit-component to read and then the real output
527531 // is created after wit-component runs.
528- if self . shared {
532+ if self . skip_wit_component ( ) {
529533 cmd. arg ( "-o" ) . arg ( self . component . output . as_ref ( ) . unwrap ( ) ) ;
530534 } else {
531535 cmd. arg ( "-o" ) . arg ( lld_output. path ( ) ) ;
@@ -541,9 +545,7 @@ impl App {
541545 bail ! ( "failed to invoke LLD: {status}" ) ;
542546 }
543547
544- // Skip componentization with `--shared` since that's creating a shared
545- // library that's not a component yet.
546- if self . shared {
548+ if self . skip_wit_component ( ) {
547549 return Ok ( ( ) ) ;
548550 }
549551
@@ -640,6 +642,13 @@ impl App {
640642 Ok ( ( ) )
641643 }
642644
645+ fn skip_wit_component ( & self ) -> bool {
646+ self . component . skip_wit_component
647+ // Skip componentization with `--shared` since that's creating a
648+ // shared library that's not a component yet.
649+ || self . shared
650+ }
651+
643652 fn lld ( & self ) -> Command {
644653 let mut lld = self . find_lld ( ) ;
645654 lld. args ( & self . lld_args ) ;
0 commit comments