Fix and simplify MSVC build's handling of xml/xslt/uuid dependencies.
authorTom Lane <[email protected]>
Sun, 11 Sep 2016 16:46:55 +0000 (12:46 -0400)
committerTom Lane <[email protected]>
Sun, 11 Sep 2016 16:46:55 +0000 (12:46 -0400)
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-.

Michael Paquier

Discussion: <CAB7nPqR0+gpu3mRQvFjf-V-bMxmiSJ6NpTg9_WzVDL+a31cV2g@mail.gmail.com>

src/tools/msvc/Mkvcbuild.pm
src/tools/msvc/Solution.pm

index b3ed1f56e21b80b1207d62faa210fa99889b100f..93dfd24a83b8e746d836044fbfffdfcccf0b132e 100644 (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';
        }
index 9cb1ad36cf31700277284fde94a641403f21bb1e..8217d06f28eb7950c28563387689178a792bfc99 100644 (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;
 }