Skip to content

Commit

Permalink
Use libs from Rtools if found
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jan 8, 2025
1 parent ce0e6e3 commit 0738b9f
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
RWINLIB = ../windows/harfbuzz
PKG_CONFIG_NAME = harfbuzz freetype2 fribidi
PKG_CONFIG ?= $(BINPREF)pkg-config
PKG_LIBS := $(shell $(PKG_CONFIG) --libs $(PKG_CONFIG_NAME))

PKG_CPPFLAGS = \
-I$(RWINLIB)/include/harfbuzz \
-I$(RWINLIB)/include/fribidi \
-I$(RWINLIB)/include/freetype2
ifneq ($(PKG_LIBS),)
$(info using $(PKG_CONFIG_NAME) from Rtools)
PKG_CPPFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_NAME))
else
RWINLIB = ../windows/harfbuzz
PKG_CPPFLAGS = -I$(RWINLIB)/include/harfbuzz -I$(RWINLIB)/include/fribidi -I$(RWINLIB)/include/freetype2
PKG_LIBS = -L$(RWINLIB)/lib$(R_ARCH) -L$(RWINLIB)/lib -lfribidi -lfreetype -lharfbuzz -lfreetype -lpng -lbz2 -lz -lrpcrt4 -lgdi32 -luuid
endif

PKG_LIBS = -L$(RWINLIB)/lib$(R_ARCH) -L$(RWINLIB)/lib \
-lfribidi -lfreetype -lharfbuzz -lfreetype -lpng -lbz2 -lz -lrpcrt4 -lgdi32 -luuid
all: $(SHLIB)

all: clean winlibs
$(OBJECTS): $(RWINLIB)

winlibs:
$(RWINLIB):
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R"

clean:
rm -f $(OBJECTS) $(SHLIB)
rm -f $(SHLIB) $(OBJECTS)

0 comments on commit 0738b9f

Please sign in to comment.