1515
1616IS_WINDOWS : bool = os .name == "nt"
1717
18+ target_triplets : list [str ] = [
19+ "x86_64-pc-windows-msvc" , "aarch64-pc-windows-msvc"
20+ ]
21+
1822
1923def main () -> None :
2024 if not IS_WINDOWS :
@@ -28,37 +32,40 @@ def main() -> None:
2832 else None
2933 )
3034
31- subprocess .run (
32- [
33- "cargo" ,
34- "build" ,
35- "--quiet" ,
36- "--manifest-path" ,
37- str (dotslash_windows_shim_root / "Cargo.toml" ),
38- "--bin=dotslash_windows_shim" ,
39- "--release" ,
40- "--target=x86_64-pc-windows-msvc" ,
41- ],
42- check = True ,
43- env = {
44- ** os .environ ,
45- "RUSTC_BOOTSTRAP" : "1" ,
46- "RUSTFLAGS" : "-Clink-arg=/DEBUG:NONE" , # Avoid embedded pdb path
47- },
48- )
35+ for triplet in target_triplets :
36+ subprocess .run (
37+ [
38+ "cargo" ,
39+ "build" ,
40+ "--quiet" ,
41+ "--manifest-path" ,
42+ str (dotslash_windows_shim_root / "Cargo.toml" ),
43+ "--bin=dotslash_windows_shim" ,
44+ "--release" ,
45+ f"--target={ triplet } " ,
46+ ],
47+ check = True ,
48+ env = {
49+ ** os .environ ,
50+ "RUSTC_BOOTSTRAP" : "1" ,
51+ "RUSTFLAGS" : "-Clink-arg=/DEBUG:NONE" , # Avoid embedded pdb path
52+ },
53+ )
4954
50- src = (
51- (
52- target_dir
53- or (dotslash_windows_shim_root / "target" / "x86_64-pc-windows-msvc" )
55+ src = (
56+ (
57+ target_dir
58+ or (dotslash_windows_shim_root / "target" / triplet )
59+ )
60+ / "release"
61+ / "dotslash_windows_shim.exe"
5462 )
55- / "release"
56- / "dotslash_windows_shim.exe"
57- )
5863
59- dest = dotslash_windows_shim_root / "dotslash_windows_shim-x86_64.exe"
64+ arch = triplet .partition ('-' )[0 ]
65+
66+ dest = dotslash_windows_shim_root / f"dotslash_windows_shim-{ arch } .exe"
6067
61- shutil .copy (src , dest )
68+ shutil .copy (src , dest )
6269
6370
6471if __name__ == "__main__" :
0 commit comments