Reduce the number of special cases to build contrib modules on windows

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-11-02T07:34:28Z
Lists: pgsql-hackers

Attachments

Hi,

At the moment we do very basic parsing of makefiles to build the
visual studio project file in order to build our contrib modules on
MSVC.  This parsing is quite basic and still requires a number of
special cases to get enough information into the project file in order
for the build to succeed.  It might be nice if we could reduce some of
those special cases so that:

a) We reduce the amount of work specific to windows when we add new
contrib modules, and;
b) We can work towards a better way for people to build their own
extensions on windows.

I admit to not being much of an expert in either perl or make, but I
came up with the attached which does allow a good number of the
special cases to be removed.

I'm keen to get some feedback on this idea.

Patch attached.

David

Commits

  1. Remove some special cases from MSVC build scripts

  2. Adjust MSVC build scripts to parse Makefiles for defines

  3. Don't duplicate references and libraries in MSVC scripts

  4. Make the includes field an array in MSVC build scripts

  5. Use the AddFile function consistently in MSVC build scripts

  6. Remove seemingly unneeded include directory in MSVC scripts