Skip to content

Commit f692583

Browse files
committed
Allow MSVC to build with Tcl 8.6.
Commit eaba54c added support for Tcl 8.6 for configure-supported platforms after verifying that pltcl works without further changes, but the MSVC tooling wasn't updated accordingly. Update MSVC to match, restructuring the code to avoid duplicating the logic for every Tcl version supported. Backpatch to all live branches, like eaba54c. In 9.4 and previous, change the patch to use backslashes rather than forward, as in the rest of the file. Reported by Paresh More, who also tested the patch I provided. Discussion: https://postgr.es/m/CAAgiCNGVw3ssBtSi3ZNstrz5k00ax=UV+_ZEHUeW_LMSGL2sew@mail.gmail.com
1 parent db73b28 commit f692583

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/tools/msvc/Mkvcbuild.pm

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,20 +249,24 @@ sub mkvcbuild
249249

250250
if ($solution->{options}->{tcl})
251251
{
252+
my $found = 0;
252253
my $pltcl =
253254
$solution->AddProject('pltcl', 'dll', 'PLs', 'src\pl\tcl');
254255
$pltcl->AddIncludeDir($solution->{options}->{tcl} . '\include');
255256
$pltcl->AddReference($postgres);
256-
if (-e $solution->{options}->{tcl} . '\lib\tcl85.lib')
257-
{
258-
$pltcl->AddLibrary(
259-
$solution->{options}->{tcl} . '\lib\tcl85.lib');
260-
}
261-
else
257+
258+
for my $tclver (qw(86t 85 84))
262259
{
263-
$pltcl->AddLibrary(
264-
$solution->{options}->{tcl} . '\lib\tcl84.lib');
260+
my $tcllib = $solution->{options}->{tcl} . "\\lib\\tcl$tclver.lib";
261+
if (-e $tcllib)
262+
{
263+
$pltcl->AddLibrary($tcllib);
264+
$found = 1;
265+
last;
266+
}
265267
}
268+
die "Unable to find $solution->{options}->{tcl}\\lib\\tcl<version>.lib"
269+
unless $found;
266270
}
267271

268272
$libpq = $solution->AddProject('libpq', 'dll', 'interfaces',

0 commit comments

Comments
 (0)