diff --git a/.github/workflows/source-gem.yml b/.github/workflows/source-gem.yml index 00708b398..dd9bf5854 100644 --- a/.github/workflows/source-gem.yml +++ b/.github/workflows/source-gem.yml @@ -42,6 +42,10 @@ jobs: ruby: "2.5" PGVERSION: 9.4.26-1-windows-x64 PGVER: "9.4" + - os: windows + ruby: "mswin" + PGVERSION: 15.1-1-windows-x64 + PGVER: "15" - os: ubuntu ruby: "head" PGVER: "15" @@ -82,7 +86,7 @@ jobs: name: source-gem - name: Install required packages Windows - if: matrix.os == 'windows' + if: matrix.os == 'windows' && matrix.ruby != 'mswin' shell: cmd run: ridk exec sh -c "pacman --sync --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-gcc" diff --git a/ext/extconf.rb b/ext/extconf.rb index 9bf1c2e5f..d9b7b38bb 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -60,6 +60,10 @@ if dlldir && RbConfig::CONFIG["RPATHFLAG"].to_s.empty? append_ldflags "-Wl,-rpath,#{dlldir.quote}" end + + if /mswin/ =~ RUBY_PLATFORM + $libs = append_library($libs, 'ws2_32') + end end $stderr.puts "Using libpq from #{dlldir}"