使用 MSVC/VS19 在 windows 上构建 libpq 和 pg_confing (postgresql 13.2)

building libpq and pg_confing on windows with MSVC/VS19 (postgresql 13.2)

长话短说,我需要依赖于 libpq 和来自 postgresql 的 pg_config 的 pythons psycopg2 站点包。我不需要整个 postgresql 只需要这两个工件。在 linux 上,构建非常简单,因为命令行构建只允许构建和安装这两个工件。有没有一种简单的方法可以在 Windows 上用 MSVC 做到这一点?也许是一些 CMake 端口?我确实查看了 Postgresql 13.2 的文档,它对 windows 构建没有用,我找不到任何关于大于 9.x

的版本的有用信息

如果至少有一种简单的方法可以为 windows 构建整个 postgresql,那将是一个好的开始。

这应该很简单,请参阅 the documentation:

To build just a single project, for example psql, run the commands:

build psql
build DEBUG psql

这还将构建 psql 所需的 libpq.dll