docs: document --target cross-compilation flag

- Add cross-compilation to README.md features and quick start
- Add cross-compilation section to docs/BuildAndTest.md
This commit is contained in:
2026-06-10 20:26:31 +03:00
parent e4e4e0d8ef
commit 8f68a9da1a
2 changed files with 22 additions and 0 deletions
+18
View File
@@ -107,6 +107,24 @@ Output = "Bin"
Build output goes to `build/` by default.
### Cross-Compilation
Use `--target <triple>` to cross-compile for a different platform. Bux generates C code and uses `clang` with the `-target` flag for cross-compilation.
```bash
# Cross-compile for ARM Linux
./buxc build --target aarch64-linux-gnu
# Cross-compile for x86_64 Linux (explicit)
./buxc build --target x86_64-linux-gnu
# Cross-compile and run project build
./buxc project --target x86_64-linux-gnu
./buxc run --target aarch64-linux-gnu
```
> **Note:** `clang` must be installed for cross-compilation. Without `--target`, Bux uses the system `cc` compiler.
---
## Running Tests