Skip to content

Commit

Permalink
Build script maintenance
Browse files Browse the repository at this point in the history
* winres is unmaintained, switch to winresource mxre/winres#40 (comment)
* Double colon syntax for build script outputs is preferred https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script
  • Loading branch information
fenhl committed Oct 8, 2024
1 parent 32168cc commit 5ac1fa2
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 21 deletions.
50 changes: 38 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crate/multiworld-bizhawk/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum Error {

#[wheel::main]
async fn main() -> Result<(), Error> {
println!("cargo:rerun-if-changed=nonexistent.foo"); // check a nonexistent file to make sure build script is always run (see https://github.com/rust-lang/cargo/issues/4213 and https://github.com/rust-lang/cargo/issues/5663)
println!("cargo::rerun-if-changed=nonexistent.foo"); // check a nonexistent file to make sure build script is always run (see https://github.com/rust-lang/cargo/issues/4213 and https://github.com/rust-lang/cargo/issues/5663)
// check for extern function definitions in C# which aren't defined in Rust
let rust_file = fs::read_to_string("../multiworld-csharp/src/lib.rs").await?;
let mut rust_functions = HashSet::new();
Expand Down
2 changes: 1 addition & 1 deletion crate/multiworld-gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ unused_qualifications = "deny"
warnings = "deny"

[build-dependencies]
winres = "0.1"
winresource = "0.1"

[dependencies]
arrayref = "0.3.7"
Expand Down
2 changes: 1 addition & 1 deletion crate/multiworld-gui/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use {
env,
io,
},
winres::WindowsResource,
winresource::WindowsResource,
};

fn main() -> io::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crate/multiworld-installer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ workspace = true

[build-dependencies]
thiserror = "1"
winres = "0.1"
winresource = "0.1"

[build-dependencies.wheel]
git = "https://github.com/fenhl/wheel"
Expand Down
4 changes: 2 additions & 2 deletions crate/multiworld-installer/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use {
io::prelude::*,
path::PathBuf,
},
winres::WindowsResource,
winresource::WindowsResource,
};
#[cfg(unix)] use {
std::{
Expand Down Expand Up @@ -40,7 +40,7 @@ enum Error {

#[wheel::main]
async fn main() -> Result<(), Error> {
println!("cargo:rerun-if-changed=nonexistent.foo"); // check a nonexistent file to make sure build script is always run (see https://github.com/rust-lang/cargo/issues/4213 and https://github.com/rust-lang/cargo/issues/5663)
println!("cargo::rerun-if-changed=nonexistent.foo"); // check a nonexistent file to make sure build script is always run (see https://github.com/rust-lang/cargo/issues/4213 and https://github.com/rust-lang/cargo/issues/5663)
if env::var_os("CARGO_CFG_WINDOWS").is_some() {
WindowsResource::new()
.set_icon("../../assets/icon.ico")
Expand Down
2 changes: 1 addition & 1 deletion crate/multiworld-updater/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ unused_qualifications = "deny"
warnings = "deny"

[build-dependencies]
winres = "0.1"
winresource = "0.1"

[dependencies]
async_zip = { version = "0.0.17", features = ["full"] }
Expand Down
2 changes: 1 addition & 1 deletion crate/multiworld-updater/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use {
env,
io,
},
winres::WindowsResource,
winresource::WindowsResource,
};

fn main() -> io::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crate/ootrmwd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {
};

fn main() {
println!("cargo:rerun-if-changed=nonexistent.foo"); // check a nonexistent file to make sure build script is always run (see https://github.com/rust-lang/cargo/issues/4213 and https://github.com/rust-lang/cargo/issues/5663)
println!("cargo::rerun-if-changed=nonexistent.foo"); // check a nonexistent file to make sure build script is always run (see https://github.com/rust-lang/cargo/issues/4213 and https://github.com/rust-lang/cargo/issues/5663)
let mut f = File::create(Path::new(&env::var_os("OUT_DIR").unwrap()).join("version.rs")).unwrap();
let version = env::var("CARGO_PKG_VERSION").unwrap().parse::<Version>().unwrap();
assert!(version.pre.is_empty());
Expand Down

0 comments on commit 5ac1fa2

Please sign in to comment.