From 25417960d906300e22e12c4e94ee631501651f9e Mon Sep 17 00:00:00 2001 From: Kasper Date: Thu, 20 Aug 2020 10:30:31 +0200 Subject: [PATCH] Added cross-compiling instructions to readme --- Cargo.toml | 3 ++- README.md | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 82f874c..3f427be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/README.md b/README.md index 7d66ebc..25c78c1 100644 --- a/README.md +++ b/README.md @@ -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. `` is the platform you're building for: + ```sh + cross build --release --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//release/`. The filename will be either `cpc` or `cpc.exe`.