From 4771acf5987cb1e52d58f0e9f1f042d135676812 Mon Sep 17 00:00:00 2001 From: Tomas Kalibera Date: Wed, 14 Aug 2024 10:18:07 +0200 Subject: [PATCH] Do not attempt to use -rpath on Windows when linking. --- R/tbb.R | 3 ++- src/Makevars.in | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/R/tbb.R b/R/tbb.R index 49b42591..4c8fc14c 100644 --- a/R/tbb.R +++ b/R/tbb.R @@ -83,7 +83,8 @@ tbbLdFlags <- function() { # shortcut if TBB_LIB defined tbbLib <- Sys.getenv("TBB_LINK_LIB", Sys.getenv("TBB_LIB", unset = TBB_LIB)) if (nzchar(tbbLib)) { - fmt <- "-L%1$s -Wl,-rpath,%1$s -ltbb -ltbbmalloc" + fmt <- if (is_windows()) "-L%1$s -ltbb -ltbbmalloc" + else "-L%1$s -Wl,-rpath,%1$s -ltbb -ltbbmalloc" return(sprintf(fmt, asBuildPath(tbbLib))) } diff --git a/src/Makevars.in b/src/Makevars.in index 5740c20b..c3171236 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -13,7 +13,11 @@ endif # If TBB_LIB is defined, link to that explicitly. ifdef TBB_LIB - PKG_LIBS = -Wl,-L"$(TBB_LIB)" -Wl,-rpath,"$(TBB_LIB)" -ltbb -ltbbmalloc + ifeq ($(OS), Windows_NT) + PKG_LIBS = -Wl,-L"$(TBB_LIB)" -ltbb -ltbbmalloc + else + PKG_LIBS = -Wl,-L"$(TBB_LIB)" -Wl,-rpath,"$(TBB_LIB)" -ltbb -ltbbmalloc + endif endif ifeq ($(OS), Windows_NT)