@@ -24,9 +24,12 @@ ifeq ($(OS), Windows_NT)
2424 ARCH=$(shell "${R_HOME}/bin/R" --vanilla -s -e 'cat(R.version$$arch)')
2525 TBB_CXXFLAGS = @CXX11FLAGS@ -DTBB_NO_LEGACY=1
2626 ifeq "$(ARCH)" "aarch64"
27- WINARM64=true
2827 PKG_CPPFLAGS += -DTBB_USE_GCC_BUILTINS
2928 TBB_CXXFLAGS += -DTBB_USE_GCC_BUILTINS
29+ CLANG_CHECK := $(shell echo | $(CC) -E -dM - | findstr __clang__)
30+ ifneq ($(CLANG_CHECK), )
31+ WINARM64_CLANG=true
32+ endif
3033 endif
3134
3235 MAKE = make
@@ -39,7 +42,7 @@ ifeq ($(OS), Windows_NT)
3942 CXXFLAGS="$(TBB_CXXFLAGS)" \
4043 PIC_KEY="@CXX11PICFLAGS@" \
4144 WARNING_SUPPRESS="" \
42- WINARM64 ="$(WINARM64)" \
45+ WINARM64_CLANG ="$(WINARM64_CLANG)" \
4346 $(MAKE)
4447
4548else
@@ -86,7 +89,9 @@ ifeq ($(USE_TBB), Windows)
8689 # rtools: turn on hacks to compensate for make and shell differences rtools<=>MinGW
8790 # compiler: overwrite default (which is cl = MS compiler)
8891 MAKE_ARGS += rtools=true compiler=gcc
89- ifneq ($(WINARM64), true)
92+ # TBB configure will detect mingw runtime with unknown arch on WINARM64_CLANG but not an
93+ # issue as we are using compiler built-ins instead of arch-specific code
94+ ifneq ($(WINARM64_CLANG), true)
9095 ifeq ($(WIN), 64)
9196 MAKE_ARGS += arch=intel64 runtime=mingw
9297 ARCH_DIR=x64/
0 commit comments