Skip to content

Commit

Permalink
Fix support for arm64 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 11, 2023
1 parent a1c573a commit 5cf782c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Makevars.ucrt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TARGET = x86_64-pc-windows-gnu
TARGET = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript.exe" "../tools/rustarch.R")
LIBDIR = myrustlib/target/$(TARGET)/release
STATLIB = $(LIBDIR)/libmyrustlib.a
PKG_LIBS = -L$(LIBDIR) -lmyrustlib -lws2_32 -ladvapi32 -luserenv -ldbghelp -lbcrypt -lntdll
Expand Down
13 changes: 13 additions & 0 deletions tools/rustarch.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# See notes in FAQ about ARM64 support:
# https://github.com/r-rust/faq#does-rust-support-windows-on-arm64-aarch64
arch <- if(grepl("aarch", R.version$platform)){
"aarch64-pc-windows-gnullvm"
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
"x86_64-pc-windows-gnullvm"
} else if(grepl("i386", R.version$platform)){
"i686-pc-windows-gnu"
} else {
"x86_64-pc-windows-gnu"
}

cat(arch)

0 comments on commit 5cf782c

Please sign in to comment.