Fix and simplify MSVC build's handling of xml/xslt/uuid dependencies.

Solution.pm mistakenly believed that the xml option requires the xslt
option, when actually the dependency is the other way around; and it
believed that libxml requires libiconv, which is not necessarily so,
so we shouldn't enforce it here.  Fix the option cross-checking logic.

Also, since AddProject already takes care of adding libxml and libxslt
include and library dependencies to every project, there's no need
for the custom code that did that in mkvcbuild.  While at it, let's
handle the similar dependencies for uuid in a similar fashion.

Given the lack of field complaints about these overly strict build
dependency requirements, there seems no need for a back-patch.

Michael Paquier

Discussion: <CAB7nPqR0+gpu3mRQvFjf-V-bMxmiSJ6NpTg9_WzVDL+a31cV2g@mail.gmail.com>
This commit is contained in:
Tom Lane 2016-09-11 12:46:55 -04:00
parent 24598337c8
commit 28e5e5648c
2 changed files with 9 additions and 25 deletions

View File

@ -381,18 +381,7 @@ sub mkvcbuild
$zic->AddDirResourceFile('src/timezone');
$zic->AddReference($libpgcommon, $libpgport);
if ($solution->{options}->{xml})
{
$contrib_extraincludes->{'pgxml'} = [
$solution->{options}->{xml} . '/include',
$solution->{options}->{xslt} . '/include',
$solution->{options}->{iconv} . '/include' ];
$contrib_extralibs->{'pgxml'} = [
$solution->{options}->{xml} . '/lib/libxml2.lib',
$solution->{options}->{xslt} . '/lib/libxslt.lib' ];
}
else
if (!$solution->{options}->{xml})
{
push @contrib_excludes, 'xml2';
}
@ -402,14 +391,7 @@ sub mkvcbuild
push @contrib_excludes, 'sslinfo';
}
if ($solution->{options}->{uuid})
{
$contrib_extraincludes->{'uuid-ossp'} =
[ $solution->{options}->{uuid} . '/include' ];
$contrib_extralibs->{'uuid-ossp'} =
[ $solution->{options}->{uuid} . '/lib/uuid.lib' ];
}
else
if (!$solution->{options}->{uuid})
{
push @contrib_excludes, 'uuid-ossp';
}

View File

@ -37,12 +37,9 @@ sub _new
unless exists $options->{float8byval};
die "float8byval not permitted on 32 bit platforms"
if $options->{float8byval} && $bits == 32;
if ($options->{xml})
if ($options->{xslt} && !$options->{xml})
{
if (!($options->{xslt} && $options->{iconv}))
{
die "XML requires both XSLT and ICONV\n";
}
die "XSLT requires XML\n";
}
$options->{blocksize} = 8
unless $options->{blocksize}; # undef or 0 means default
@ -555,6 +552,11 @@ sub AddProject
$proj->AddIncludeDir($self->{options}->{xslt} . '\include');
$proj->AddLibrary($self->{options}->{xslt} . '\lib\libxslt.lib');
}
if ($self->{options}->{uuid})
{
$proj->AddIncludeDir($self->{options}->{uuid} . '\include');
$proj->AddLibrary($self->{options}->{uuid} . '\lib\uuid.lib');
}
return $proj;
}