Skip to content

Commit 7ee0f86

Browse files
authored
Pass self.definitions to armasm[64].exe. (#868)
1 parent 7f3acb5 commit 7ee0f86

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/lib.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,20 @@ impl Build {
22022202
cmd.arg("-g");
22032203
}
22042204

2205-
println!("cargo:warning=The MSVC ARM assemblers do not support -D flags");
2205+
for &(ref key, ref value) in self.definitions.iter() {
2206+
cmd.arg("-PreDefine");
2207+
if let Some(ref value) = *value {
2208+
if let Ok(i) = value.parse::<i32>() {
2209+
cmd.arg(&format!("{} SETA {}", key, i));
2210+
} else if value.starts_with('"') && value.ends_with('"') {
2211+
cmd.arg(&format!("{} SETS {}", key, value));
2212+
} else {
2213+
cmd.arg(&format!("{} SETS \"{}\"", key, value));
2214+
}
2215+
} else {
2216+
cmd.arg(&format!("{} SETL {}", key, "{TRUE}"));
2217+
}
2218+
}
22062219
} else {
22072220
if self.get_debug() {
22082221
cmd.arg("-Zi");

0 commit comments

Comments
 (0)