From d7f5fa37e9999798c3da23436df4e2fbd0d45970 Mon Sep 17 00:00:00 2001 From: markoburcul Date: Mon, 9 Feb 2026 18:53:29 +0100 Subject: [PATCH] makefile: make -lpq conditional based on POSTGRES env var --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index be2bc172c..8c148937f 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,12 @@ ifeq ($(detected_OS),Windows) NIM_PARAMS += --passL:"-Lvendor/nim-nat-traversal/vendor/miniupnp/miniupnpc" NIM_PARAMS += --passL:"-Lvendor/nim-nat-traversal/vendor/libnatpmp-upstream" - LIBS = -lws2_32 -lbcrypt -liphlpapi -luserenv -lntdll -lminiupnpc -lnatpmp -lpq + LIBS = -lws2_32 -lbcrypt -liphlpapi -luserenv -lntdll -lminiupnpc -lnatpmp + + ifeq ($(POSTGRES), 1) + LIBS += -lpq + endif + NIM_PARAMS += $(foreach lib,$(LIBS),--passL:"$(lib)") # Allow multiple definitions when linking Rust static library with GCC