Skip to content

rust-wiiu/cafe-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Cafe Scripts

These scripts are designed to simplify the building Wii U homebrew software with Rust. They use a custom target specification along with the (currently unstable) cargo script feature.

Setup

  1. Add submodule (or clone)
git submodule add https://github.com/rust-wiiu/cafe-scripts scripts
git submodule update --init --recursive
  1. Add rust-toolchain.toml1
[toolchain]
channel = "nightly"
components = ["rust-src", "rust-analyzer"]
  1. Add .cargo/config.toml
[alias]
wuhb = "-Zscript scripts/wuhb.rs"

[build]
target = "scripts/powerpc-cafe-nintendo.json"

[unstable]
build-std = ["core", "alloc", "compiler_builtins"]
build-std-features = ["compiler-builtins-mem"]
json-target-spec = true
unstable-options = true
  1. Run script via cargo (flags are passed to cargo build)
cargo wuhb # --release

Update

git submodule update --remote --merge scripts

How Does it Work?

A target specification is a description of a machine type which is used by Rust, more specificailly LLVM and the linker, to create machine code acording to the available hardware. For example, you may be already using the x86_64-unknown-linux-gnu target2, meaning you compile code for a x86-64 architecture linux system with available GNU abi.

cargo script is a proposed feature to create single-file packages (no manifest, src folder, etc.), especially useful for cross-platform scripting or experimentation. It it currently in stabilization phase.

Footnotes

  1. The toolchain requires the usage of nightly because of build-std and the custom target specification.

  2. Get all installed targets / toolchains: rustup toolchain list. List all official supported targets: rustc --print target-list.

About

Build scripts

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks