From 7462a1428e33823f765fd16dfc8d65fb5d40c455 Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Sat, 9 Aug 2025 01:24:17 -0400 Subject: [PATCH 1/2] Add Windows fixes so abc compiles natively with GCC. --- Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index eeff20d24d..dbf7198c4d 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,11 @@ $(call abc_info,$(MSG_PREFIX)Using AR=$(AR)) $(call abc_info,$(MSG_PREFIX)Using LD=$(LD)) PROG := abc + OS := $(shell uname -s) +ifneq ($(filter MINGW%,$(OS)),) +OS := MINGW +endif MODULES := \ $(wildcard src/ext*) \ @@ -151,10 +155,15 @@ ifneq ($(OS), $(filter $(OS), FreeBSD OpenBSD NetBSD)) LIBS += -ldl endif -ifneq ($(OS), $(filter $(OS), FreeBSD OpenBSD NetBSD Darwin)) +ifneq ($(OS), $(filter $(OS), FreeBSD OpenBSD NetBSD Darwin MINGW)) LIBS += -lrt endif +# For PathMatchSpecA. +ifeq ($(OS), MINGW) + LIBS += -lshlwapi +endif + ifdef ABC_USE_LIBSTDCXX LIBS += -lstdc++ $(call abc_info,$(MSG_PREFIX)Using explicit -lstdc++) @@ -164,7 +173,7 @@ $(call abc_info,$(MSG_PREFIX)Using CFLAGS=$(CFLAGS)) CXXFLAGS += $(CFLAGS) -std=c++17 -fno-exceptions SRC := -GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags +GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags $(PROG).in .PHONY: all default tags clean docs cmake_info @@ -231,9 +240,17 @@ clean: tags: etags `find . -type f -regex '.*\.\(c\|h\)'` +ifeq ($(OS), MINGW) +$(PROG): $(OBJ) + @echo "$(MSG_PREFIX)\`\` Constructing Response File:" $(notdir @$@.in) + $(file >$@.in,$^ $(LDFLAGS) $(LIBS)) + @echo "$(MSG_PREFIX)\`\` Building binary:" $(notdir $@) + $(VERBOSE)$(LD) -o $@ @$@.in +else $(PROG): $(OBJ) @echo "$(MSG_PREFIX)\`\` Building binary:" $(notdir $@) $(VERBOSE)$(LD) -o $@ $^ $(LDFLAGS) $(LIBS) +endif lib$(PROG).a: $(LIBOBJ) @echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@) From 81706c0a9e56d22d2ba0aaa713f831895ae6bd65 Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Fri, 3 Apr 2026 00:15:13 +0100 Subject: [PATCH 2/2] Run CI on windows-latest --- .github/workflows/build-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 7b6e613041..6852efc58a 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -8,7 +8,7 @@ jobs: build-windows: - runs-on: windows-2025 + runs-on: windows-latest steps: @@ -75,4 +75,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: package-windows - path: staging/ \ No newline at end of file + path: staging/