Skip to content

Commit

Permalink
Add debuginfo flags for msvc assemblers
Browse files Browse the repository at this point in the history
When code is being built with debuginfo, we need to instruct the
assemblers accordingly.
  • Loading branch information
nagisa committed Oct 31, 2022
1 parent f914e8a commit c05e9d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1961,8 +1961,16 @@ impl Build {
cmd.arg("-I").arg(directory);
}
if target.contains("aarch64") || target.contains("arm") {
if self.get_debug() {
cmd.arg("-g");
}

println!("cargo:warning=The MSVC ARM assemblers do not support -D flags");
} else {
if self.get_debug() {
cmd.arg("-Zi");
}

for &(ref key, ref value) in self.definitions.iter() {
if let Some(ref value) = *value {
cmd.arg(&format!("-D{}={}", key, value));
Expand Down

0 comments on commit c05e9d9

Please sign in to comment.