Skip to content

Add Windows build support (MSVC) and fix test portability - #1

Merged
davecramer merged 2 commits into
mainfrom
windows-build-support
Jul 2, 2026
Merged

Add Windows build support (MSVC) and fix test portability#1
davecramer merged 2 commits into
mainfrom
windows-build-support

Conversation

@davecramer

Copy link
Copy Markdown
Contributor
  • Add tests/test_platform.h with cross-platform dlopen/dlsym/dlclose macros mapping to LoadLibrary/GetProcAddress/FreeLibrary on Windows
  • Fix test files to include windows.h before sql.h (required by MSVC)
  • Replace bare dlfcn.h includes with test_platform.h
  • Add dsn_config_read_file() for file-based DSN reading in tests; uses GetPrivateProfileStringA on Windows since SQLGetPrivateProfileString always reads from registry regardless of filename argument
  • Update CI workflow: install pkgconf via pip, generate native.ini to work around Meson rejecting Strawberry Perl pkg-config on Windows

- Add tests/test_platform.h with cross-platform dlopen/dlsym/dlclose
  macros mapping to LoadLibrary/GetProcAddress/FreeLibrary on Windows
- Fix test files to include windows.h before sql.h (required by MSVC)
- Replace bare dlfcn.h includes with test_platform.h
- Add dsn_config_read_file() for file-based DSN reading in tests;
  uses GetPrivateProfileStringA on Windows since SQLGetPrivateProfileString
  always reads from registry regardless of filename argument
- Update CI workflow: install pkgconf via pip, generate native.ini to
  work around Meson rejecting Strawberry Perl pkg-config on Windows
…om PATH

The choco PostgreSQL package ships a libpq.pc with the build machine's
prefix baked in (D:/a/postgresql-packaging-foundation/...). Rewrite it
to point to the actual install location.

Also remove Strawberry Perl from PATH since it injects ccache (which
wraps cl.exe) and a broken pkg-config.
@davecramer
davecramer merged commit b2605f4 into main Jul 2, 2026
3 checks passed
@davecramer
davecramer deleted the windows-build-support branch July 6, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant