Targets & cross-compilation#
By default cargo fc runs for a single target — the same one Cargo would pick. You can instead declare a list of target triples and turn each run into a full matrix of:
selected packages × effective targets × feature combinationsWith targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] declared in Cargo.toml, a single cargo fc run checks every feature combination on every target:
$ cargo fc --summary-only check --workspace Checking [1/8] app ( target = x86_64-unknown-linux-gnu, features = [] ) Checking [2/8] app ( target = x86_64-unknown-linux-gnu, features = [simd] ) Checking [3/8] app ( target = x86_64-unknown-linux-gnu, features = [simd, std] ) Checking [4/8] app ( target = x86_64-unknown-linux-gnu, features = [std] ) Checking [5/8] app ( target = wasm32-unknown-unknown, features = [] ) Checking [6/8] app ( target = wasm32-unknown-unknown, features = [simd] ) Checking [7/8] app ( target = wasm32-unknown-unknown, features = [simd, std] ) Checking [8/8] app ( target = wasm32-unknown-unknown, features = [std] ) Finished 8 feature combinations for 1 package across 2 targets in 0.00s PASS app ( target = x86_64-unknown-linux-gnu, 0 errors, 0 warnings, features = [] ) PASS app ( target = x86_64-unknown-linux-gnu, 0 errors, 0 warnings, features = [simd] ) PASS app ( target = x86_64-unknown-linux-gnu, 0 errors, 0 warnings, features = [simd, std] ) PASS app ( target = x86_64-unknown-linux-gnu, 0 errors, 0 warnings, features = [std] ) PASS app ( target = wasm32-unknown-unknown, 0 errors, 0 warnings, features = [] ) PASS app ( target = wasm32-unknown-unknown, 0 errors, 0 warnings, features = [simd] ) PASS app ( target = wasm32-unknown-unknown, 0 errors, 0 warnings, features = [simd, std] ) PASS app ( target = wasm32-unknown-unknown, 0 errors, 0 warnings, features = [std] )
- Configured targets — declare the target list and control which commands expand it.
- Build drivers — how native-C dependencies cross-compile, and how to choose the driver.
- Installing targets — opt-in installation of missing
rustuptarget components.