Browse Source
* Add -t CLI option * Run rustfmt * Default to JS target * Move Target to generator module * Pass Target when building * cmd/run: support target option * Reformat code * Get rid of backend_* features * Remove all feature checks * ci: remove --all-features We don't have any features left so there's no reason to enable them * docs: update backends page * Add --target to changelog * Implement Copy for Target That's a very small enum so it doesn't matter if we duplicate it. * Make LLVM support optional with llvm featurepull/24/head
Alexey
3 years ago
committed by
GitHub
13 changed files with 135 additions and 102 deletions
@ -1,25 +1,23 @@
|
||||
# Backends |
||||
|
||||
Antimony currently implements a JavaScript backend, but a C backend is in development. WASM, ARM and x86 are planned. |
||||
The backend can be specified in the `Cargo.toml` file in the root of the project: |
||||
|
||||
```toml |
||||
[features] |
||||
... |
||||
Backend can be specified when running on building with `--target` (`-t`) option, default is `js`: |
||||
|
||||
default = ["backend_c"] |
||||
``` |
||||
|
||||
If you're working on an unstable backend, you can override the backend using the `--features --no-default-features` flag of the cargo CLI: |
||||
|
||||
``` |
||||
cargo run --no-default-features --features backend_llvm ... |
||||
```sh |
||||
sb -t c build in.sb --out-file out |
||||
``` |
||||
|
||||
## Available Backends |
||||
|
||||
| Target Language | Identifier | Stability notice | |
||||
| :-------------- | :------------- | :--------------- | |
||||
| Node.js | `backend_node` | mostly stable | |
||||
| LLVM | `backend_llvm` | unstable | |
||||
| C | `backend_c` | unstable | |
||||
| Node.js | `js` | mostly stable | |
||||
| LLVM | `llvm` | unstable | |
||||
| C | `c` | unstable | |
||||
|
||||
LLVM also requires to enable `llvm` feature when building: |
||||
|
||||
```sh |
||||
cargo build --features llvm |
||||
``` |
||||
|
@ -1,2 +1 @@
|
||||
#[cfg(feature = "backend_c")] |
||||
mod c_tests; |
||||
|
Loading…
Reference in new issue