Added cross-compiling instructions to readme

This commit is contained in:
Kasper 2020-08-20 10:30:31 +02:00
parent ba2c1ce84e
commit 25417960d9
2 changed files with 18 additions and 1 deletions

View File

@ -2,10 +2,11 @@
name = "cpc"
version = "0.1.0"
description = "evaluates math expressions, with support for units and conversion between units"
readme = "README.md"
authors = ["Kasper Henningsen"]
edition = "2018"
readme = "README.md"
license = "MIT"
homepage = "https://github.com/probablykasper/cpc#readme"
repository = "https://github.com/probablykasper/cpc"
keywords = ["cpc", "math", "expression", "string", "evaluator", "eval", "units", "convert", "conversion"]
categories = ["mathematics", "science", "parsing", "text-processing", "value-formatting"]

View File

@ -172,3 +172,19 @@ Nice list of units: https://support.google.com/websearch/answer/3284611
- Electric current, capacitance, charge, conductance, volts
- Flow rate
- Frequency
### Cross-compiling
1. [Install Docker](https://docs.docker.com/get-docker/)
2. Install `cross`:
```
cargo install cross
```
3. Build. `<target>` is the platform you're building for:
```sh
cross build --release --target <target>
```
- macOS target: `x86_64-apple-darwin` (Only works on macOS)
- Linux target: `x86_64-unknown-linux-musl`
- Windows target: `x86_64-pc-windows-gnu`
- In case you want to compile for more targets, check out [the targets `cross` supports](https://github.com/rust-embedded/cross#supported-targets)
4. The compiled binaries will now be available inside `target/<target>/release/`. The filename will be either `cpc` or `cpc.exe`.