On Sat, Feb 26, 2022 at 05:46:26PM -0800, Andres Freund wrote:
> Pushed.  Attached is the remainder, 0003, the move of libpq_pipeline to
> src/interfaces/libpq that I'm not planning to push for now.

I saw that Andrew just pushed something to start building this under MSVC.

In case it's of any interest, I had done this differently a while back.
This probably doesn't apply except on top of some other patches, but you get
the idea.

commit 923f8a1c2cbea35cb01d1599caa2a81e3186181c
Author: Justin Pryzby <pryz...@telsasoft.com>
Date:   Mon Feb 28 01:31:10 2022 -0600

    f!
    
    ci-os-only: windows

diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 4364ab943fd..71ec747e544 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -44,6 +44,7 @@ my $contrib_extraincludes  = {};
 my $contrib_extrasource    = {
        'uri-regress' => ['src/interfaces/libpq/test/uri-regress.c'],
        'testclient' => ['src/interfaces/libpq/test/testclient.c'],
+       'libpq_pipeline' => ['src/interfaces/libpq/test/libpq_pipeline.c'],
 };
 my @contrib_excludes = (
        'bool_plperl',      'commit_ts',
@@ -475,7 +476,7 @@ sub mkvcbuild
                push @contrib_excludes, 'uuid-ossp';
        }
 
-       foreach my $subdir ('contrib', 'src/test/modules', 
'src/interfaces/libpq')
+       foreach my $subdir ('contrib', 'src/test/modules') #, 
'src/interfaces/libpq')
        {
                opendir($D, $subdir) || croak "Could not opendir on $subdir!\n";
                while (my $d = readdir($D))
@@ -804,6 +805,20 @@ sub mkvcbuild
                $p->AddReference($postgres);
        }
 
+       $mf = Project::read_file('src/interfaces/libpq/test/Makefile');
+       $mf =~ s{\\\r?\n}{}g;
+       $mf =~ m{PROGRAMS\s*=\s*(.*)$}m
+         || die 'Could not match in src/interfaces/libpq/test/Makefile' . "\n";
+       foreach my $prg (split /\s+/, $1)
+       {
+               my $proj = $solution->AddProject($prg, 'exe', 'bin');
+               $proj->AddFile("src/interfaces/libpq/test/$prg.c"); # implicit 
source file
+               $proj->AddIncludeDir('src/interfaces/libpq');
+               # XXX: pipeline needs pgcommon and ws2, but uri-regress doesn't
+               $proj->AddReference($libpq, $libpgport, $libpgcommon);
+               $proj->AddLibrary('ws2_32.lib');
+       }
+
        $mf = Project::read_file('src/bin/scripts/Makefile');
        $mf =~ s{\\\r?\n}{}g;
        $mf =~ m{PROGRAMS\s*=\s*(.*)$}m


Reply via email to