We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cdf73b commit 525abafCopy full SHA for 525abaf
build.rs
@@ -207,10 +207,12 @@ fn build() -> io::Result<()> {
207
let cc = cc::Build::new();
208
let compiler = cc.get_compiler();
209
let compiler = compiler.path().file_stem().unwrap().to_str().unwrap();
210
- let suffix_pos = compiler.rfind('-').unwrap(); // cut off "-gcc"
211
- let prefix = compiler[0..suffix_pos].trim_end_matches("-wr"); // "wr-c++" compiler
+ if let Some(suffix_pos) = compiler.rfind('-') {
+ // cut off "-gcc"
212
+ let prefix = compiler[0..suffix_pos].trim_end_matches("-wr"); // "wr-c++" compiler
213
+ configure.arg(format!("--cross-prefix={}-", prefix));
214
+ }
215
- configure.arg(format!("--cross-prefix={}-", prefix));
216
configure.arg(format!(
217
"--arch={}",
218
env::var("CARGO_CFG_TARGET_ARCH").unwrap()
0 commit comments