Longer README about how to use this instead of cargo run (#1054)

* Longer README about how to use this instead of `cargo run`

Resolves #1052.

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
This commit is contained in:
Vitaly Shukela 2020-06-25 18:59:46 +03:00 committed by GitHub
parent a3cd293148
commit eda840a498
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,14 +13,20 @@ $ ./test.sh --release
## Usage
`$cg_clif_dir` is the directory you cloned this repo into in the following instructions.
rustc_codegen_cranelift can be used as a near-drop-in replacement for `cargo build` or `cargo run` for existing projects.
Assuming `$cg_clif_dir` is the directory you cloned this repo into and you followed the instructions (`prepare.sh` and `test.sh`).
### Cargo
In the directory with your project (where you can do the usual `cargo build`), run:
```bash
$ CHANNEL="release" $cg_clif_dir/cargo.sh run
```
This should build and run your project with rustc_codegen_cranelift instead of the usual LLVM backend.
If you compiled cg_clif in debug mode (aka you didn't pass `--release` to `./test.sh`) you should use `CHANNEL="debug"` instead or omit `CHANNEL="release"` completely.
### Rustc