Skip to content

Commit 75e95dd

Browse files
committed
Attempt to fix jsonb_plpython build on Windows
1 parent e81fc9b commit 75e95dd

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

src/tools/msvc/Install.pm

+1
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ sub CopyContribFiles
465465
next if ($d eq "xml2" && !defined($config->{xml}));
466466
next if ($d eq "hstore_plperl" && !defined($config->{perl}));
467467
next if ($d eq "hstore_plpython" && !defined($config->{python}));
468+
next if ($d eq "jsonb_plpython" && !defined($config->{python}));
468469
next if ($d eq "ltree_plpython" && !defined($config->{python}));
469470
next if ($d eq "sepgsql");
470471

src/tools/msvc/Mkvcbuild.pm

+26-14
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ my $contrib_extrasource = {
4343
my @contrib_excludes = (
4444
'commit_ts', 'hstore_plperl',
4545
'hstore_plpython', 'intagg',
46+
'jsonb_plpython',
4647
'ltree_plpython', 'pgcrypto',
4748
'sepgsql', 'brin',
4849
'test_extensions', 'test_pg_dump',
@@ -506,6 +507,11 @@ sub mkvcbuild
506507
'hstore', 'contrib/hstore');
507508
$hstore_plpython->AddDefine(
508509
'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"');
510+
my $jsonb_plpython = AddTransformModule(
511+
'jsonb_plpython' . $pymajorver, 'contrib/jsonb_plpython',
512+
'plpython' . $pymajorver, 'src/pl/plpython');
513+
$jsonb_plpython->AddDefine(
514+
'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"');
509515
my $ltree_plpython = AddTransformModule(
510516
'ltree_plpython' . $pymajorver, 'contrib/ltree_plpython',
511517
'plpython' . $pymajorver, 'src/pl/plpython',
@@ -850,20 +856,23 @@ sub AddTransformModule
850856
my $n_src = shift;
851857
my $pl_proj_name = shift;
852858
my $pl_src = shift;
853-
my $transform_name = shift;
854-
my $transform_src = shift;
859+
my $type_name = shift;
860+
my $type_src = shift;
855861

856-
my $transform_proj = undef;
857-
foreach my $proj (@{ $solution->{projects}->{'contrib'} })
862+
my $type_proj = undef;
863+
if ($type_name)
858864
{
859-
if ($proj->{name} eq $transform_name)
865+
foreach my $proj (@{ $solution->{projects}->{'contrib'} })
860866
{
861-
$transform_proj = $proj;
862-
last;
867+
if ($proj->{name} eq $type_name)
868+
{
869+
$type_proj = $proj;
870+
last;
871+
}
863872
}
873+
die "could not find base module $type_name for transform module $n"
874+
if (!defined($type_proj));
864875
}
865-
die "could not find base module $transform_name for transform module $n"
866-
if (!defined($transform_proj));
867876

868877
my $pl_proj = undef;
869878
foreach my $proj (@{ $solution->{projects}->{'PLs'} })
@@ -894,13 +903,16 @@ sub AddTransformModule
894903
}
895904

896905
# Add base module dependencies
897-
$p->AddIncludeDir($transform_src);
898-
$p->AddIncludeDir($transform_proj->{includes});
899-
foreach my $trans_lib (@{ $transform_proj->{libraries} })
906+
if ($type_proj)
900907
{
901-
$p->AddLibrary($trans_lib);
908+
$p->AddIncludeDir($type_src);
909+
$p->AddIncludeDir($type_proj->{includes});
910+
foreach my $type_lib (@{ $type_proj->{libraries} })
911+
{
912+
$p->AddLibrary($type_lib);
913+
}
914+
$p->AddReference($type_proj);
902915
}
903-
$p->AddReference($transform_proj);
904916

905917
return $p;
906918
}

src/tools/msvc/vcregress.pl

+2
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ sub subdircheck
326326
# Makefile for more details regarding Python-version specific
327327
# dependencies.
328328
if ( $module eq "hstore_plpython"
329+
|| $module eq "jsonb_plpython"
329330
|| $module eq "ltree_plpython")
330331
{
331332
die "Python not enabled in configuration"
@@ -376,6 +377,7 @@ sub contribcheck
376377
next if ($module eq "xml2" && !defined($config->{xml}));
377378
next if ($module eq "hstore_plperl" && !defined($config->{perl}));
378379
next if ($module eq "hstore_plpython" && !defined($config->{python}));
380+
next if ($module eq "jsonb_plpython" && !defined($config->{python}));
379381
next if ($module eq "ltree_plpython" && !defined($config->{python}));
380382
next if ($module eq "sepgsql");
381383

0 commit comments

Comments
 (0)