(js_file_path, src_file_path, cflags)
| 200 | |
| 201 | |
| 202 | def generate_cmd(js_file_path, src_file_path, cflags): |
| 203 | # Compile the program. |
| 204 | show('Compiling generated code...') |
| 205 | |
| 206 | if any('libcxxabi' in f for f in cflags): |
| 207 | compiler = shared.EMXX |
| 208 | else: |
| 209 | compiler = shared.EMCC |
| 210 | |
| 211 | # -O1+ produces calls to iprintf, which libcompiler_rt doesn't support |
| 212 | cmd = [compiler, *cflags, '-o', js_file_path, src_file_path, |
| 213 | '-O0', |
| 214 | '-Werror', |
| 215 | '-Wno-format', |
| 216 | '-sBOOTSTRAPPING_STRUCT_INFO', |
| 217 | '-sWASM_ASYNC_COMPILATION=0', |
| 218 | '-sINCOMING_MODULE_JS_API=', |
| 219 | '-sSTRICT', |
| 220 | '-sSUPPORT_LONGJMP=0', |
| 221 | '-sASSERTIONS=0'] |
| 222 | |
| 223 | # Default behavior for emcc is to warn for binaryen version check mismatches |
| 224 | # so we should try to match that behavior. |
| 225 | cmd += ['-Wno-error=version-check'] |
| 226 | |
| 227 | # TODO(sbc): Remove this one we remove the test_em_config_env_var test |
| 228 | cmd += ['-Wno-deprecated'] |
| 229 | |
| 230 | show(shlex.join(cmd)) |
| 231 | return cmd |
| 232 | |
| 233 | |
| 234 | def inspect_headers(headers, cflags): |
no test coverage detected