Skip to content

Commit 5cf782c

Browse files
committed
Fix support for arm64 on Windows
1 parent a1c573a commit 5cf782c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/Makevars.ucrt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TARGET = x86_64-pc-windows-gnu
1+
TARGET = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript.exe" "../tools/rustarch.R")
22
LIBDIR = myrustlib/target/$(TARGET)/release
33
STATLIB = $(LIBDIR)/libmyrustlib.a
44
PKG_LIBS = -L$(LIBDIR) -lmyrustlib -lws2_32 -ladvapi32 -luserenv -ldbghelp -lbcrypt -lntdll

tools/rustarch.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# See notes in FAQ about ARM64 support:
2+
# https://github.com/r-rust/faq#does-rust-support-windows-on-arm64-aarch64
3+
arch <- if(grepl("aarch", R.version$platform)){
4+
"aarch64-pc-windows-gnullvm"
5+
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
6+
"x86_64-pc-windows-gnullvm"
7+
} else if(grepl("i386", R.version$platform)){
8+
"i686-pc-windows-gnu"
9+
} else {
10+
"x86_64-pc-windows-gnu"
11+
}
12+
13+
cat(arch)

0 commit comments

Comments
 (0)