Skip to content

Commit

Permalink
Maybe this works
Browse files Browse the repository at this point in the history
  • Loading branch information
alloncm committed Dec 21, 2024
1 parent b49ffc9 commit d960aac
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.73.0
rustflags: ""
cache-directories: "/home/runner/.cargo/bin
C:\\Users\\runneradmin\\.cargo\\bin"
Expand Down
17 changes: 12 additions & 5 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[config]
default_to_workspace = false

[env]
nightly_version = "nightly-2023-10-05"

[tasks.all]
dependencies = ["test", "sdl", "rpios", "rpibm", "libretro"]

Expand Down Expand Up @@ -37,25 +40,29 @@ install_crate_args=["--locked", "--version", "0.2.5"]
command = "cross"
args = ["build", "--release", "--target", "armv7-unknown-linux-gnueabihf", "--bin", "rpios","--no-default-features", "--features", "os"]

[tasks.pre-rpibm]
command = "rustup"
args = ["toolchain", "install", "${nightly_version}"]

[tasks.rpibm]
toolchain = "nightly"
toolchain = "${nightly_version}"
install_crate = "cargo-binutils"
command = "rust-objcopy"
args = ["target/armv7a-none-eabihf/release/baremetal", "-O", "binary", "kernel7.img"]
dependencies = ["build_rpi_baremetal","install_llvm_tools"]
dependencies = ["pre-rpibm", "build_rpi_baremetal","install_llvm_tools"]

[tasks.build_rpi_baremetal]
toolchain = "nightly"
toolchain = "${nightly_version}"
command = "cargo"
args = ["build", "--release", "--target", "armv7a-none-eabihf","--package", "magenboy_rpi", "--bin", "baremetal", "-Z", "build-std=core"]
dependencies = ["install_rust_src"]

[tasks.install_llvm_tools]
toolchain = "nightly"
toolchain = "${nightly_version}"
install_crate = {rustup_component_name = "llvm-tools-preview"}

[tasks.install_rust_src]
toolchain = "nightly"
toolchain = "${nightly_version}"
command = "rustup"
args = ["component", "add", "rust-src"]

Expand Down
6 changes: 4 additions & 2 deletions rpi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ fn main(){
let rpi_version = std::env::var(config::RPI_ENV_VAR_NAME)
.expect(std::format!("{} env must be set", config::RPI_ENV_VAR_NAME).as_str());
println!("cargo:rustc-cfg=rpi=\"{}\"", rpi_version);

// Silent warnings for this cfg
println!("cargo:rustc-check-cfg=cfg(rpi, values(\"4\", \"2\"))");
}

// Silent warnings for this cfg
println!("cargo::rustc-check-cfg=cfg(rpi, values(\"4\", \"2\"))");
println!("cargo::rustc-check-cfg=cfg(rpi)");
println!("cargo:rustc-check-cfg=cfg(rpi)");
}
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "1.73.0"
components = [ "rust-src" ]
profile = "default"

0 comments on commit d960aac

Please sign in to comment.