From eda840a498d1cf796d3be386c8f985ec0d17e91f Mon Sep 17 00:00:00 2001 From: Vitaly Shukela Date: Thu, 25 Jun 2020 18:59:46 +0300 Subject: [PATCH] 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 --- Readme.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 1146f7e415ed..23167f82bfeb 100644 --- a/Readme.md +++ b/Readme.md @@ -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