Skip to content

Commit 61100b1

Browse files
committed
correctly pass clang to TBB configure when R is using clang
1 parent 15b4fc6 commit 61100b1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ RcppParallel 4.3.7
44
* Add tbbmalloc library
55
* Add support for TBB on Solaris
66
* Fix failure to compile on OS X Snow Leopard R toolchain
7+
* Correctly pass clang to TBB configure when R is using clang
78

89
RcppParallel 4.3.6
910
------------------------------------------------------------------------

src/Makevars

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ PKG_CPPFLAGS += -DRCPP_PARALLEL_USE_TBB=1
2929

3030
MAKE_ARGS := CXXFLAGS=-DTBB_NO_LEGACY=1 tbb_release tbbmalloc_release tbb_build_prefix=lib
3131

32-
# What I really want is startswith but this doesn't appear to be available
33-
ifneq (,$(findstring clang,$(CC)))
34-
MAKE_ARGS += compiler=clang
35-
endif
36-
3732
ifeq ($(USE_TBB), Windows)
3833

3934
# rtools: turn on hacks to compensate for make and shell differences rtools<=>MinGW
@@ -68,7 +63,11 @@ all: tbb $(SHLIB)
6863
tbb:
6964
mkdir -p ../inst/lib/$(ARCH_DIR); \
7065
cd tbb/src; \
71-
make $(MAKE_ARGS); \
66+
if [[ "$(CC)" == clang* ]]; then \
67+
make compiler=clang $(MAKE_ARGS); \
68+
else \
69+
make $(MAKE_ARGS); \
70+
fi; \
7271
cd ../..; \
7372
cp tbb/build/lib_release/$(TBB_COPY_PATTERN) ../inst/lib/$(ARCH_DIR)
7473

0 commit comments

Comments
 (0)