Skip to content

Commit

Permalink
Fix rustc-cfg/rustc-env problem on Windows targets
Browse files Browse the repository at this point in the history
It seems quoted value format is not supported on Windows!
  • Loading branch information
mqudsi committed Jan 19, 2024
1 parent ed963e5 commit a938860
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rsconf"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fn main() {
println!("cargo:rustc-env=RSCONF_TARGET=\"{}\"", std::env::var("TARGET").unwrap());
println!("cargo:rustc-env=RSCONF_HOST=\"{}\"", std::env::var("HOST").unwrap());
println!("cargo:rustc-env=RSCONF_TARGET={}", std::env::var("TARGET").unwrap());
println!("cargo:rustc-env=RSCONF_HOST={}", std::env::var("HOST").unwrap());
}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub fn set_cfg_value(name: &str, value: &str) {
if value.chars().any(|c| c == '"') {
panic!("Invalid value {value} for cfg {name}");
}
println!("cargo:rustc-cfg={name}=\"{value}\"");
println!("cargo:rustc-cfg={name}={value}\"");
}

/// Makes available an environment variable available to your code at build time, letting you use
Expand All @@ -205,7 +205,7 @@ pub fn set_env_value(name: &str, value: &str) {
if value.chars().any(|c| c == '"') {
panic!("Invalid value {value} for env var {name}");
}
println!("cargo:rustc-env={name}=\"{value}\"");
println!("cargo:rustc-env={name}={value}");
}

/// Add a path to the list of directories rust will search when attempting to find a library to link
Expand Down

0 comments on commit a938860

Please sign in to comment.