Skip to content

Commit 5e70630

Browse files
committed
[win][arm64ec] Fix finding assembler and setting is_arm for Arm64EC
1 parent 94a7cc3 commit 5e70630

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/lib.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ impl Build {
13991399
}
14001400

14011401
let mut cmd = compiler.to_command();
1402-
let is_arm = matches!(target.arch, "aarch64" | "arm");
1402+
let is_arm = matches!(target.arch, "aarch64" | "arm64ec" | "arm");
14031403
command_add_output_file(
14041404
&mut cmd,
14051405
&obj,
@@ -1845,7 +1845,7 @@ impl Build {
18451845
}
18461846
cmd
18471847
};
1848-
let is_arm = matches!(target.arch, "aarch64" | "arm");
1848+
let is_arm = matches!(target.arch, "aarch64" | "arm64ec" | "arm");
18491849
command_add_output_file(
18501850
&mut cmd,
18511851
&obj.dst,
@@ -2594,14 +2594,11 @@ impl Build {
25942594

25952595
fn msvc_macro_assembler(&self) -> Result<Command, Error> {
25962596
let target = self.get_target()?;
2597-
let tool = if target.arch == "x86_64" {
2598-
"ml64.exe"
2599-
} else if target.arch == "arm" {
2600-
"armasm.exe"
2601-
} else if target.arch == "aarch64" {
2602-
"armasm64.exe"
2603-
} else {
2604-
"ml.exe"
2597+
let tool = match target.arch {
2598+
"x86_64" => "ml64.exe",
2599+
"arm" => "armasm.exe",
2600+
"aarch64" | "arm64ec" => "armasm64.exe",
2601+
_ => "ml.exe",
26052602
};
26062603
let mut cmd = self
26072604
.windows_registry_find(&target, tool)
@@ -2610,7 +2607,7 @@ impl Build {
26102607
for directory in self.include_directories.iter() {
26112608
cmd.arg("-I").arg(&**directory);
26122609
}
2613-
if target.arch == "aarch64" || target.arch == "arm" {
2610+
if matches!(target.arch, "aarch64" | "arm64ec" | "arm") {
26142611
if self.get_debug() {
26152612
cmd.arg("-g");
26162613
}

0 commit comments

Comments
 (0)