You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Segfault and UX of the c3c project add-target subcommand (#1729)
* Fix UX of the `c3c project add-target` subcommand
- Fix segfault on `project.json` containing empty map `{}`
- Enable `add-target` to operate on non-existing project files
- Extend `add-target` syntax to accept source through CLI args
This enables the following workflow without friction and needless
crashes:
```console
$ cat > main.c3 <<END
import std::io;
fn void main() {
io::printfn("Hello, World");
}
END
$ c3c project add-target main executable main.c3
$ c3c run
```
* Fix read_project() call in fetch_project()
* Keep the style of curlies consistent
if (at_end() ||next_is_opt()) error_exit("Expected a target type like 'executable' or 'static-lib'");
223
223
options->project_options.target_type= (TargetType)get_valid_enum_from_string(next_arg(), "type", targets, ELEMENTLEN(targets), "a target type like 'executable' or 'static-lib'");
0 commit comments