|
1 | 1 | { |
2 | 2 | "version": { |
| 3 | + "category": "General", |
3 | 4 | "description": "Prints just the compiler's version and exits.", |
4 | 5 | "type": "b", |
5 | 6 | "alias": "v" |
6 | 7 | }, |
7 | 8 | "help": { |
| 9 | + "category": "General", |
8 | 10 | "description": "Prints this message and exits.", |
9 | 11 | "type": "b", |
10 | 12 | "alias": "h" |
11 | 13 | }, |
| 14 | + "noColors": { |
| 15 | + "category": "General", |
| 16 | + "description": "Disables terminal colors.", |
| 17 | + "type": "b", |
| 18 | + "default": false |
| 19 | + }, |
| 20 | + |
12 | 21 | "optimize": { |
| 22 | + "category": "Optimization", |
13 | 23 | "description": [ |
14 | | - "Optimizes the module. Also has the usual shorthands:", |
| 24 | + "Optimizes the module. Typical shorthands are:", |
15 | 25 | "", |
16 | | - " -O Uses defaults. Equivalent to -O3s", |
17 | | - " -O0 Equivalent to --optimizeLevel 0", |
18 | | - " -O1 Equivalent to --optimizeLevel 1", |
19 | | - " -O2 Equivalent to --optimizeLevel 2", |
20 | | - " -O3 Equivalent to --optimizeLevel 3", |
21 | | - " -Oz Equivalent to -O but with --shrinkLevel 2", |
22 | | - " -O3s Equivalent to -O3 with --shrinkLevel 1 etc.", |
| 26 | + " Default optimizations -O / -O3s", |
| 27 | + " Make a release build -O --noAssert", |
| 28 | + " Make a debug build --debug", |
| 29 | + " Optimize for speed -O3", |
| 30 | + " Optimize for size -O3z --converge", |
23 | 31 | "" |
24 | 32 | ], |
25 | 33 | "type": "b", |
26 | 34 | "alias": "O" |
27 | 35 | }, |
28 | 36 | "optimizeLevel": { |
| 37 | + "category": "Optimization", |
29 | 38 | "description": "How much to focus on optimizing code. [0-3]", |
30 | 39 | "type": "i" |
31 | 40 | }, |
32 | 41 | "shrinkLevel": { |
| 42 | + "category": "Optimization", |
33 | 43 | "description": "How much to focus on shrinking code size. [0-2, s=1, z=2]", |
34 | 44 | "type": "i" |
35 | 45 | }, |
36 | 46 | "converge": { |
| 47 | + "category": "Optimization", |
37 | 48 | "description": "Re-optimizes until no further improvements can be made.", |
38 | 49 | "type": "b", |
39 | 50 | "default": false |
40 | 51 | }, |
41 | | - "validate": { |
42 | | - "description": "Validates the module using Binaryen. Exits if invalid.", |
| 52 | + "noAssert": { |
| 53 | + "category": "Optimization", |
| 54 | + "description": "Replaces assertions with just their value without trapping.", |
43 | 55 | "type": "b", |
44 | | - "alias": "c", |
45 | 56 | "default": false |
46 | 57 | }, |
47 | | - "baseDir": { |
48 | | - "description": "Specifies the base directory of input and output files.", |
| 58 | + "runtime": { |
| 59 | + "category": "Optimization", |
| 60 | + "description": [ |
| 61 | + "Specifies the runtime variant to include in the program.", |
| 62 | + "", |
| 63 | + " full Default runtime based on TLSF and reference counting.", |
| 64 | + " half Same as 'full', but not exported to the host.", |
| 65 | + " stub Minimal stub implementation without free/GC support.", |
| 66 | + " none Same as 'stub', but not exported to the host.", |
| 67 | + "" |
| 68 | + ], |
49 | 69 | "type": "s", |
50 | | - "default": "." |
| 70 | + "default": "full" |
51 | 71 | }, |
| 72 | + |
52 | 73 | "outFile": { |
| 74 | + "category": "Output", |
53 | 75 | "description": "Specifies the output file. File extension indicates format.", |
54 | 76 | "type": "s", |
55 | 77 | "alias": "o" |
56 | 78 | }, |
57 | 79 | "binaryFile": { |
| 80 | + "category": "Output", |
58 | 81 | "description": "Specifies the binary output file (.wasm).", |
59 | 82 | "type": "s", |
60 | 83 | "alias": "b" |
61 | 84 | }, |
62 | 85 | "textFile": { |
| 86 | + "category": "Output", |
63 | 87 | "description": "Specifies the text output file (.wat).", |
64 | 88 | "type": "s", |
65 | 89 | "alias": "t" |
66 | 90 | }, |
67 | 91 | "asmjsFile": { |
| 92 | + "category": "Output", |
68 | 93 | "description": "Specifies the asm.js output file (.js).", |
69 | 94 | "type": "s", |
70 | 95 | "alias": "a" |
71 | 96 | }, |
72 | 97 | "idlFile": { |
| 98 | + "category": "Output", |
73 | 99 | "description": "Specifies the WebIDL output file (.webidl).", |
74 | 100 | "type": "s", |
75 | 101 | "alias": "i" |
76 | 102 | }, |
77 | 103 | "tsdFile": { |
| 104 | + "category": "Output", |
78 | 105 | "description": "Specifies the TypeScript definition output file (.d.ts).", |
79 | 106 | "type": "s", |
80 | 107 | "alias": "d" |
81 | 108 | }, |
| 109 | + |
82 | 110 | "sourceMap": { |
| 111 | + "category": "Debugging", |
83 | 112 | "description": [ |
84 | 113 | "Enables source map generation. Optionally takes the URL", |
85 | 114 | "used to reference the source map from the binary file." |
86 | 115 | ], |
87 | 116 | "type": "s" |
88 | 117 | }, |
89 | | - "runtime": { |
90 | | - "description": [ |
91 | | - "Specifies the runtime variant to include in the program.", |
92 | | - "", |
93 | | - " full Default runtime based on TLSF and reference counting.", |
94 | | - " half Same as 'full', but not exported to the host.", |
95 | | - " stub Minimal stub implementation without free/GC support.", |
96 | | - " none Same as 'stub', but not exported to the host.", |
97 | | - "" |
98 | | - ], |
99 | | - "type": "s", |
100 | | - "default": "full" |
101 | | - }, |
102 | | - "noUnsafe": { |
103 | | - "description": [ |
104 | | - "Disallows the use of unsafe features in user code.", |
105 | | - "Does not affect library files and external modules." |
106 | | - ], |
107 | | - "type": "b", |
108 | | - "default": false |
109 | | - }, |
110 | 118 | "debug": { |
| 119 | + "category": "Debugging", |
111 | 120 | "description": "Enables debug information in emitted binaries.", |
112 | 121 | "type": "b", |
113 | 122 | "default": false |
114 | 123 | }, |
115 | | - "noAssert": { |
116 | | - "description": "Replaces assertions with just their value without trapping.", |
117 | | - "type": "b", |
118 | | - "default": false |
119 | | - }, |
120 | | - "noEmit": { |
121 | | - "description": "Performs compilation as usual but does not emit code.", |
122 | | - "type": "b", |
123 | | - "default": false |
124 | | - }, |
| 124 | + |
125 | 125 | "importMemory": { |
| 126 | + "category": "Features", |
126 | 127 | "description": "Imports the memory provided as 'env.memory'.", |
127 | 128 | "type": "b", |
128 | 129 | "default": false |
129 | 130 | }, |
130 | 131 | "sharedMemory": { |
| 132 | + "category": "Features", |
131 | 133 | "description": "Declare memory as shared by settings the max shared memory.", |
132 | 134 | "type": "i", |
133 | 135 | "default": 0 |
134 | 136 | }, |
135 | | - "memoryBase": { |
136 | | - "description": "Sets the start offset of compiler-generated static memory.", |
137 | | - "type": "i", |
138 | | - "default": 0 |
139 | | - }, |
140 | 137 | "importTable": { |
| 138 | + "category": "Features", |
141 | 139 | "description": "Imports the function table provided as 'env.table'.", |
142 | 140 | "type": "b", |
143 | 141 | "default": false |
144 | 142 | }, |
145 | 143 | "exportTable": { |
| 144 | + "category": "Features", |
146 | 145 | "description": "Exports the function table as 'table'.", |
147 | 146 | "type": "b", |
148 | 147 | "default": false |
149 | 148 | }, |
150 | 149 | "explicitStart": { |
151 | | - "description": "Exports an explicit start function to be called manually.", |
| 150 | + "category": "Features", |
| 151 | + "description": "Exports an explicit '_start' function to call.", |
152 | 152 | "type": "b", |
153 | 153 | "default": false |
154 | 154 | }, |
155 | | - "lib": { |
| 155 | + "enable": { |
| 156 | + "category": "Features", |
156 | 157 | "description": [ |
157 | | - "Adds one or multiple paths to custom library components and", |
158 | | - "uses exports of all top-level files at this path as globals." |
| 158 | + "Enables WebAssembly features being disabled by default.", |
| 159 | + "", |
| 160 | + " sign-extension Sign-extension operations", |
| 161 | + " bulk-memory Bulk memory operations.", |
| 162 | + " simd SIMD types and operations.", |
| 163 | + " threads Threading and atomic operations.", |
| 164 | + " reference-types Reference types and operations.", |
| 165 | + "" |
159 | 166 | ], |
160 | | - "type": "s" |
| 167 | + "TODO_doesNothingYet": [ |
| 168 | + " nontrapping-f2i Non-trapping float to integer ops.", |
| 169 | + " exception-handling Exception handling.", |
| 170 | + " tail-calls Tail call operations." |
| 171 | + ], |
| 172 | + "type": "S" |
161 | 173 | }, |
162 | | - "path": { |
| 174 | + "disable": { |
| 175 | + "category": "Features", |
163 | 176 | "description": [ |
164 | | - "Adds one or multiple paths to package resolution, similar", |
165 | | - "to node_modules. Prefers an 'ascMain' entry in a package's", |
166 | | - "package.json and falls back to an inner 'assembly/' folder." |
| 177 | + "Disables WebAssembly features being enabled by default.", |
| 178 | + "", |
| 179 | + " mutable-globals Mutable global imports and exports.", |
| 180 | + "" |
167 | 181 | ], |
168 | 182 | "type": "S" |
169 | 183 | }, |
170 | 184 | "use": { |
| 185 | + "category": "Features", |
171 | 186 | "description": [ |
172 | 187 | "Aliases a global object under another name, e.g., to switch", |
173 | | - "the default 'Math' implementation used: --use Math=JSMath" |
| 188 | + "the default 'Math' implementation used: --use Math=JSMath", |
| 189 | + "Can also be used to introduce an integer constant." |
174 | 190 | ], |
175 | 191 | "type": "S", |
176 | 192 | "alias": "u" |
177 | 193 | }, |
| 194 | + "memoryBase": { |
| 195 | + "category": "Features", |
| 196 | + "description": "Sets the start offset of compiler-generated static memory.", |
| 197 | + "type": "i", |
| 198 | + "default": 0 |
| 199 | + }, |
| 200 | + |
| 201 | + "transform": { |
| 202 | + "category": "API", |
| 203 | + "description": "Specifies the path to a custom transform to 'require'.", |
| 204 | + "type": "S" |
| 205 | + }, |
| 206 | + |
| 207 | + "validate": { |
| 208 | + "category": "Binaryen", |
| 209 | + "description": "Validates the module using Binaryen. Exits if invalid.", |
| 210 | + "type": "b", |
| 211 | + "alias": "c", |
| 212 | + "default": false |
| 213 | + }, |
178 | 214 | "trapMode": { |
| 215 | + "category": "Binaryen", |
179 | 216 | "description": [ |
180 | 217 | "Sets the trap mode to use.", |
181 | 218 | "", |
|
188 | 225 | "default": "allow" |
189 | 226 | }, |
190 | 227 | "runPasses": { |
| 228 | + "category": "Binaryen", |
191 | 229 | "description": [ |
192 | 230 | "Specifies additional Binaryen passes to run after other", |
193 | 231 | "optimizations, if any. See: Binaryen/src/passes/pass.cpp" |
194 | 232 | ], |
195 | 233 | "type": "s" |
196 | 234 | }, |
197 | | - "enable": { |
198 | | - "description": [ |
199 | | - "Enables WebAssembly features that are disabled by default.", |
200 | | - "", |
201 | | - " sign-extension Sign-extension operations", |
202 | | - " bulk-memory Bulk memory operations.", |
203 | | - " simd SIMD types and operations.", |
204 | | - " threads Threading and atomic operations.", |
205 | | - " reference-types Reference types and operations.", |
206 | | - "" |
207 | | - ], |
208 | | - "TODO_doesNothingYet": [ |
209 | | - " nontrapping-f2i Non-trapping float to integer ops.", |
210 | | - " exception-handling Exception handling.", |
211 | | - " tail-calls Tail call operations." |
212 | | - ], |
213 | | - "type": "S" |
| 235 | + |
| 236 | + "baseDir": { |
| 237 | + "description": "Specifies the base directory of input and output files.", |
| 238 | + "type": "s", |
| 239 | + "default": "." |
214 | 240 | }, |
215 | | - "disable": { |
| 241 | + "noUnsafe": { |
216 | 242 | "description": [ |
217 | | - "Disables WebAssembly features that are enabled by default.", |
218 | | - "", |
219 | | - " mutable-globals Mutable global imports and exports.", |
220 | | - "" |
| 243 | + "Disallows the use of unsafe features in user code.", |
| 244 | + "Does not affect library files and external modules." |
221 | 245 | ], |
222 | | - "type": "S" |
| 246 | + "type": "b", |
| 247 | + "default": false |
223 | 248 | }, |
224 | | - "transform": { |
225 | | - "description": "Specifies the path to a custom transform to 'require'.", |
226 | | - "type": "S" |
| 249 | + "noEmit": { |
| 250 | + "description": "Performs compilation as usual but does not emit code.", |
| 251 | + "type": "b", |
| 252 | + "default": false |
| 253 | + }, |
| 254 | + "measure": { |
| 255 | + "description": "Prints measuring information on I/O and compile times.", |
| 256 | + "type": "b", |
| 257 | + "default": false |
227 | 258 | }, |
228 | 259 | "pedantic": { |
229 | 260 | "description": "Make yourself sad for no good reason.", |
230 | 261 | "type": "b", |
231 | 262 | "default": false |
232 | 263 | }, |
| 264 | + "lib": { |
| 265 | + "description": [ |
| 266 | + "Adds one or multiple paths to custom library components and", |
| 267 | + "uses exports of all top-level files at this path as globals." |
| 268 | + ], |
| 269 | + "type": "s" |
| 270 | + }, |
| 271 | + "path": { |
| 272 | + "description": [ |
| 273 | + "Adds one or multiple paths to package resolution, similar", |
| 274 | + "to node_modules. Prefers an 'ascMain' entry in a package's", |
| 275 | + "package.json and falls back to an inner 'assembly/' folder." |
| 276 | + ], |
| 277 | + "type": "S" |
| 278 | + }, |
233 | 279 | "traceResolution": { |
234 | 280 | "description": "Enables tracing of package resolution.", |
235 | 281 | "type": "b", |
|
240 | 286 | "type": "b", |
241 | 287 | "default": false |
242 | 288 | }, |
243 | | - "measure": { |
244 | | - "description": "Prints measuring information on I/O and compile times.", |
245 | | - "type": "b", |
246 | | - "default": false |
247 | | - }, |
248 | 289 | "printrtti": { |
249 | 290 | "description": "Prints the module's runtime type information to stderr.", |
250 | 291 | "type": "b", |
251 | 292 | "default": false |
252 | 293 | }, |
253 | | - "noColors": { |
254 | | - "description": "Disables terminal colors.", |
255 | | - "type": "b", |
256 | | - "default": false |
257 | | - }, |
258 | 294 | " ...": { |
259 | 295 | "description": "Specifies node.js options (CLI only). See: node --help" |
260 | 296 | }, |
| 297 | + |
261 | 298 | "-Os": { "value": { "optimize": true, "shrinkLevel": 1 } }, |
262 | 299 | "-Oz": { "value": { "optimize": true, "shrinkLevel": 2 } }, |
263 | 300 | "-O0": { "value": { "optimizeLevel": 0, "shrinkLevel": 0 } }, |
|
0 commit comments