Skip to content

Commit 544498f

Browse files
authored
Merge pull request #223 from kalibera/no-rpath-on-windows
Do not attempt to use -rpath on Windows when linking.
2 parents 8c000aa + 4771acf commit 544498f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

R/tbb.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ tbbLdFlags <- function() {
8383
# shortcut if TBB_LIB defined
8484
tbbLib<- Sys.getenv("TBB_LINK_LIB", Sys.getenv("TBB_LIB", unset=TBB_LIB))
8585
if (nzchar(tbbLib)) {
86-
fmt<-"-L%1$s -Wl,-rpath,%1$s -ltbb -ltbbmalloc"
86+
fmt<-if (is_windows()) "-L%1$s -ltbb -ltbbmalloc"
87+
else"-L%1$s -Wl,-rpath,%1$s -ltbb -ltbbmalloc"
8788
return(sprintf(fmt, asBuildPath(tbbLib)))
8889
}
8990

src/Makevars.in

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ endif
1313

1414
# If TBB_LIB is defined, link to that explicitly.
1515
ifdef TBB_LIB
16-
PKG_LIBS = -Wl,-L"$(TBB_LIB)" -Wl,-rpath,"$(TBB_LIB)" -ltbb -ltbbmalloc
16+
ifeq ($(OS), Windows_NT)
17+
PKG_LIBS = -Wl,-L"$(TBB_LIB)" -ltbb -ltbbmalloc
18+
else
19+
PKG_LIBS = -Wl,-L"$(TBB_LIB)" -Wl,-rpath,"$(TBB_LIB)" -ltbb -ltbbmalloc
20+
endif
1721
endif
1822

1923
ifeq ($(OS), Windows_NT)

0 commit comments

Comments
 (0)
close