Skip to content

Commit 0020779

Browse files
authored
Switch linking on Windows to use pkg-config when available. (#478)
1 parent af1b35f commit 0020779

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Makevars.win

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
PKG_CPPFLAGS = -DR_NO_REMAP -DSTRICT_R_HEADERS
22

3-
PKG_LIBS = \
4-
-lgit2 -lpcre -lssh2 -lz -lssl -lcrypto -lgcrypt -lgpg-error \
3+
ifeq (,$(shell pkg-config --version 2>/dev/null))
4+
PKG_LIBS = \
5+
-lgit2 -lpcre -lpcre -lssh2 -lz -lssl -lcrypto -lgcrypt -lgpg-error \
56
-lwinhttp -lws2_32 -lcrypt32 -lole32 -lrpcrt4
7+
PKG_CPPFLAGS += -DPCRE_STATIC
8+
else
9+
PKG_LIBS = $(shell pkg-config --libs libgit2)
10+
PKG_CPPFLAGS += $(shell pkg-config --cflags libgit2)
11+
endif
612

713
all: clean
814

0 commit comments

Comments
 (0)