Skip to content

Commit 3716a5e

Browse files
committed
Use static linking in Windows to not depend on MinGW DLLs.
1 parent a20e3c3 commit 3716a5e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ SRCS := $(foreach sdir,$(SRC_DIRS),$(wildcard $(sdir)/*.cpp))
2626
OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRCS))
2727

2828
CXX_FLAGS := -ggdb -MMD -MP
29+
LD_FLAGS :=
2930

30-
ifneq ($(OS),Windows_NT)
31+
ifeq ($(OS),Windows_NT)
32+
LD_FLAGS += -static-libgcc -static-libstdc++
33+
else
3134
CXX_FLAGS += -fPIC
3235
endif
3336

@@ -64,4 +67,4 @@ $(foreach bdir,$(OBJ_DIRS),$(eval $(call compile,$(bdir))))
6467
-include $(addsuffix .d,$(basename $(OBJS)))
6568

6669
$(LIB_DIR)/libfbjava.$(SHRLIB_EXT): $(OBJ_DIR)/fbjava/fbjava.o
67-
$(LD) -shared $^ -o $@ -lfbclient
70+
$(LD) -shared $(LD_FLAGS) $^ -o $@ -lfbclient

0 commit comments

Comments
 (0)