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:
@@ -24,6 +24,9 @@ cd hello
|
||||
|
||||
# Build and run
|
||||
bux run
|
||||
|
||||
# Cross-compile for ARM Linux (requires clang)
|
||||
bux build --target aarch64-linux-gnu
|
||||
```
|
||||
|
||||
---
|
||||
@@ -201,6 +204,7 @@ func Main() -> int {
|
||||
| **CTFE** | `const func` — compile-time function execution |
|
||||
| **Trait Bounds** | `func Max<T: Comparable>(a: T, b: T) -> T` |
|
||||
| **Package Manager** | `bux add`, `bux install`, `bux.lock`, path + git deps |
|
||||
| **Cross-Compilation** | `--target <triple>` via clang (e.g. `aarch64-linux-gnu`) |
|
||||
| **Tooling** | `bux new`, `bux build`, `bux run`, `bux test`, `bux check` |
|
||||
|
||||
---
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user