| OLD | NEW |
| (Empty) |
| 1 # Mojo Rust Public Bindings | |
| 2 | |
| 3 This crate contains the public Mojo bindings for Rust. | |
| 4 | |
| 5 ## Build Instructions within Mojo Source Tree | |
| 6 | |
| 7 In the Mojo source tree, this crate gets compiled directly with examples, so for | |
| 8 instructions on how to use those examples, please see the //examples directory | |
| 9 at the root of the repository. | |
| 10 | |
| 11 Additionally, the Rust tests run as part of the overarching test suite, invoked | |
| 12 by running | |
| 13 | |
| 14 ```bash | |
| 15 mojo/tools/mojob.py test | |
| 16 ``` | |
| 17 | |
| 18 from the root directory. | |
| 19 | |
| 20 ## Standalone Build Instructions | |
| 21 | |
| 22 1. Build Mojo Dependencies (from source root) | |
| 23 | |
| 24 ```bash | |
| 25 mojo/tools/mojob.py gn | |
| 26 mojo/tools/mojob.py build | |
| 27 ``` | |
| 28 | |
| 29 2. Build with Cargo (from this directory) | |
| 30 | |
| 31 First, set the Mojo output directory in order for Cargo to be able to find the | |
| 32 Mojo dependencies: | |
| 33 | |
| 34 ```bash | |
| 35 export MOJO_OUT_DIR=/path/to/out/Debug | |
| 36 ``` | |
| 37 | |
| 38 Then build normally using Cargo: | |
| 39 | |
| 40 ```bash | |
| 41 cargo build [--release] | |
| 42 ``` | |
| 43 | |
| 44 Additional non-standard environment variables that Cargo will respond to: | |
| 45 * MOJO_RUST_NO_EMBED - Specifies to not bundle the Mojo embedder or link | |
| 46 against libstdc++, however tests will not work. | |
| 47 | |
| 48 3. Test | |
| 49 | |
| 50 Note: if you set MOJO_RUST_NO_EMBED, running tests will fail. | |
| 51 | |
| 52 ```bash | |
| 53 cargo test [--release] | |
| 54 ``` | |
| 55 | |
| OLD | NEW |