Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libs from Rtools if found #178

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: '4.4'}
- {os: windows-latest, r: '4.3'}
- {os: windows-latest, r: '4.2'}
- {os: windows-latest, r: '4.1'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
Expand Down
31 changes: 19 additions & 12 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
PKG_CONFIG_NAME = freetype2 libpng libtiff-4 libjpeg
PKG_CONFIG ?= $(BINPREF)pkg-config
RAGG_LIBS := $(shell $(PKG_CONFIG) --libs $(PKG_CONFIG_NAME))

ifneq ($(RAGG_LIBS),)
$(info using $(PKG_CONFIG_NAME) from Rtools)
RAGG_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_NAME))
else
RWINLIB = ../windows/harfbuzz
RAGG_CFLAGS = -I$(RWINLIB)/include -I$(RWINLIB)/include/freetype2
RAGG_LIBS = -L$(RWINLIB)/lib$(R_ARCH) -L$(RWINLIB)/lib -lfreetype -lharfbuzz -lfreetype -lpng -lz -ltiff -ljpeg -lbz2 -lrpcrt4 -lgdi32 -lws2_32
endif

PKG_LIBS = -Lagg -lstatagg $(RAGG_LIBS)
PKG_CPPFLAGS = -DSTRICT_R_HEADERS -I./agg/include $(RAGG_CFLAGS)

AGG_OBJECTS = agg/src/agg_curves.o agg/src/agg_font_freetype.o \
agg/src/agg_image_filters.o agg/src/agg_trans_affine.o \
agg/src/agg_vcgen_dash.o agg/src/agg_vcgen_stroke.o

PKG_CPPFLAGS = -DSTRICT_R_HEADERS \
-I$(RWINLIB)/include -I$(RWINLIB)/include/freetype2 \
-I./agg/include \

PKG_LIBS = -Lagg -lstatagg \
-L$(RWINLIB)/lib$(R_ARCH) -L$(RWINLIB)/lib \
-lfreetype -lharfbuzz -lfreetype -lpng -lz -ltiff -ljpeg \
-lbz2 -lrpcrt4 -lgdi32 -lws2_32

STATLIB = agg/libstatagg.a

all: clean winlibs
all: $(SHLIB)

$(SHLIB): $(STATLIB)

$(STATLIB): $(AGG_OBJECTS)

winlibs:
$(OBJECTS): $(RWINLIB)

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

clean:
rm -f $(OBJECTS) $(STATLIB) $(SHLIB) $(AGG_OBJECTS)
rm -f $(SHLIB) $(OBJECTS) $(AGG_OBJECTS) $(STATLIB)
Loading