diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3acfe2c4..cfaea815 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: run: make $FLAGS env: FLAGS: ${{ format('{0} {1} {2}', steps.make_flags.outputs.proto_flags, steps.make_flags.outputs.compiler_flags, steps.make_flags.outputs.debug_flags) }} - build_windows: + build_windows_msvc: runs-on: windows-latest strategy: fail-fast: false @@ -86,3 +86,25 @@ jobs: uses: actions/checkout@v4 - name: Build and run tests run: nmake /F Makefile.windows + build_windows_msys2: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + sys: [mingw64, mingw32, ucrt64, clang64] + steps: + - name: Set up MSYS2 and compiler + uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.sys}} + pacboy: >- + toolchain:p + install: >- + make + diff + - name: Check out code + uses: actions/checkout@v4 + - name: Build and run tests + shell: msys2 {0} + run: | + make diff --git a/Makefile b/Makefile index 0de4c8d3..532d91fd 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,10 @@ OBJ_FILES := $(SRC_FILES:.c=.o) override CFLAGS += -g -I. -I./vendor -I./src/include -I./src/postgres/include -Wall -Wno-unused-function -Wno-unused-value -Wno-unused-variable -fno-strict-aliasing -fwrapv -fPIC +ifeq ($(OS),Windows_NT) +override CFLAGS += -I./src/postgres/include/port/win32 +endif + override PG_CONFIGURE_FLAGS += -q --without-readline --without-zlib --without-icu override TEST_CFLAGS += -g -I. -I./vendor -Wall