@@ -34,6 +34,10 @@ pub struct CmdLineOpts {
34
34
/// Path to output directory
35
35
#[ clap( default_value = "./generated" ) ]
36
36
output_directory : std:: path:: PathBuf ,
37
+ /// Customize the name of the generated Rust crate.
38
+ /// Default: sandboxed-<input-file-name-base>
39
+ #[ clap( long) ]
40
+ crate_name : Option < String > ,
37
41
/// Prevent reformatting, for debug purposes
38
42
#[ clap( short, long) ]
39
43
prevent_reformat : bool ,
@@ -81,6 +85,11 @@ pub struct CmdLineOpts {
81
85
/// Generate a `no_std` library, limiting usage to `core` and `alloc`
82
86
#[ clap( long) ]
83
87
no_std_library : bool ,
88
+ /// Generate statically allocated, heapless code (implies --no-std-library,
89
+ /// requires --fixed-mem-size)
90
+ /// (Warning: experimental performance impact)
91
+ #[ clap( long) ]
92
+ no_alloc : bool ,
84
93
}
85
94
86
95
fn main ( ) -> Maybe < ( ) > {
@@ -106,6 +115,12 @@ fn main() -> Maybe<()> {
106
115
if opts. generate_as_wasi_library {
107
116
opts. generate_wasi_executable = true ;
108
117
}
118
+ if opts. no_alloc {
119
+ if opts. fixed_mem_size . is_none ( ) {
120
+ return Err ( eyre ! ( "Must use --fixed-mem-size when using --no-alloc" ) ) ;
121
+ }
122
+ opts. no_std_library = true ;
123
+ }
109
124
110
125
let inp = std:: fs:: read ( & opts. input_path ) ?;
111
126
println ! ( "Finished reading" ) ;
0 commit comments