Skip to content

Commit 90898af

Browse files
committed
MSVC: Include modules of src/test/modules in build
commit_ts, being only a module used for test purposes, is ignored in the process for now. Author: Michael Paquier Reviewed by: Andrew Dunstan
1 parent b5e384e commit 90898af

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

src/tools/msvc/Mkvcbuild.pm

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ my $libpgcommon;
2828
my $postgres;
2929
my $libpq;
3030

31-
# Set of variables for contrib modules
31+
# Set of variables for modules in contrib/ and src/test/modules/
3232
my $contrib_defines = { 'refint' => 'REFINT_VERBOSE' };
3333
my @contrib_uselibpq =
3434
('dblink', 'oid2name', 'postgres_fdw', 'vacuumlo');
@@ -50,7 +50,7 @@ my $contrib_extraincludes =
5050
my $contrib_extrasource = {
5151
'cube' => [ 'contrib\cube\cubescan.l', 'contrib\cube\cubeparse.y' ],
5252
'seg' => [ 'contrib\seg\segscan.l', 'contrib\seg\segparse.y' ], };
53-
my @contrib_excludes = ('pgcrypto', 'intagg', 'sepgsql');
53+
my @contrib_excludes = ('pgcrypto', 'commit_ts', 'intagg', 'sepgsql');
5454

5555
# Set of variables for frontend modules
5656
my $frontend_defines = { 'initdb' => 'FRONTEND' };
@@ -564,15 +564,18 @@ sub mkvcbuild
564564
my $mf = Project::read_file('contrib/pgcrypto/Makefile');
565565
GenerateContribSqlFiles('pgcrypto', $mf);
566566

567-
opendir($D, 'contrib') || croak "Could not opendir on contrib!\n";
568-
while (my $d = readdir($D))
567+
foreach my $subdir ('contrib', 'src/test/modules')
569568
{
570-
next if ($d =~ /^\./);
571-
next unless (-f "contrib/$d/Makefile");
572-
next if (grep { /^$d$/ } @contrib_excludes);
573-
AddContrib($d);
569+
opendir($D, $subdir) || croak "Could not opendir on $subdir!\n";
570+
while (my $d = readdir($D))
571+
{
572+
next if ($d =~ /^\./);
573+
next unless (-f "$subdir/$d/Makefile");
574+
next if (grep { /^$d$/ } @contrib_excludes);
575+
AddContrib($subdir, $d);
576+
}
577+
closedir($D);
574578
}
575-
closedir($D);
576579

577580
$mf =
578581
Project::read_file('src\backend\utils\mb\conversion_procs\Makefile');
@@ -689,14 +692,15 @@ sub AddSimpleFrontend
689692
# Add a simple contrib project
690693
sub AddContrib
691694
{
695+
my $subdir = shift;
692696
my $n = shift;
693-
my $mf = Project::read_file('contrib\\' . $n . '\Makefile');
697+
my $mf = Project::read_file("$subdir/$n/Makefile");
694698

695699
if ($mf =~ /^MODULE_big\s*=\s*(.*)$/mg)
696700
{
697701
my $dn = $1;
698702
my $proj =
699-
$solution->AddProject($dn, 'dll', 'contrib', 'contrib\\' . $n);
703+
$solution->AddProject($dn, 'dll', 'contrib', "$subdir/$n");
700704
$proj->AddReference($postgres);
701705
AdjustContribProj($proj);
702706
}
@@ -705,16 +709,17 @@ sub AddContrib
705709
foreach my $mod (split /\s+/, $1)
706710
{
707711
my $proj =
708-
$solution->AddProject($mod, 'dll', 'contrib', 'contrib\\' . $n);
709-
$proj->AddFile('contrib\\' . $n . '\\' . $mod . '.c');
712+
$solution->AddProject($mod, 'dll', 'contrib', "$subdir/$n");
713+
my $filename = $mod . '.c';
714+
$proj->AddFile($subdir . '\\' . $n . '\\' . $mod . '.c');
710715
$proj->AddReference($postgres);
711716
AdjustContribProj($proj);
712717
}
713718
}
714719
elsif ($mf =~ /^PROGRAM\s*=\s*(.*)$/mg)
715720
{
716721
my $proj =
717-
$solution->AddProject($1, 'exe', 'contrib', 'contrib\\' . $n);
722+
$solution->AddProject($1, 'exe', 'contrib', "$subdir/$n");
718723
AdjustContribProj($proj);
719724
}
720725
else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy