diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-05 06:41:45 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-05 06:41:45 +0900 |
| commit | f64ab73b841377f044e727ee1d9e0bcf55c6b626 (patch) | |
| tree | f87a6a2c766791dbe0a6b1dfb6599216b661050f /src/cli.c | |
| parent | d31f9ba65586887ac662a86887a8ffe87774081b (diff) | |
| download | ducc-f64ab73b841377f044e727ee1d9e0bcf55c6b626.tar.gz ducc-f64ab73b841377f044e727ee1d9e0bcf55c6b626.tar.zst ducc-f64ab73b841377f044e727ee1d9e0bcf55c6b626.zip | |
feat: minimal wasm backend
Diffstat (limited to 'src/cli.c')
| -rw-r--r-- | src/cli.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -14,6 +14,7 @@ CliArgs* parse_cli_args(int argc, char** argv) { int positional_arguments_start = -1; bool opt_c = false; bool opt_E = false; + bool opt_wasm = false; bool opt_MMD = false; StrArray include_dirs; strings_init(&include_dirs); @@ -62,6 +63,8 @@ CliArgs* parse_cli_args(int argc, char** argv) { exit(0); } else if (strcmp(argv[i], "--std=gnu23") == 0) { // ignore --std=gnu23 + } else if (strcmp(argv[i], "--wasm") == 0) { + opt_wasm = true; } else { fatal_error("unknown option: %s", argv[i]); } @@ -73,10 +76,11 @@ CliArgs* parse_cli_args(int argc, char** argv) { CliArgs* a = calloc(1, sizeof(CliArgs)); a->input_filename = argv[positional_arguments_start]; a->output_filename = output_filename; - a->output_assembly = !output_filename || str_ends_with(output_filename, ".s"); + a->output_assembly = !output_filename || str_ends_with(output_filename, ".s") || opt_wasm; a->only_compile = opt_c; a->preprocess_only = opt_E; a->totally_deligate_to_gcc = false; + a->wasm = opt_wasm; a->gcc_command = NULL; a->generate_deps = opt_MMD; a->include_dirs = include_dirs; |
