visual studio 2017 build support
Here I attached a small patch that adds the build support for
visual studio 2017.
The tools version number is still 14.X, irrespective of VS 2017
version of 15.0. I modified the versions accordingly.
Regards,
Hari Babu
Fujitsu Australia
Attachments:
vs2017_build_support.patchapplication/octet-stream; name=vs2017_build_support.patchDownload
diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index f5dfb91..540c945 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -19,10 +19,10 @@
<para>
There are several different ways of building PostgreSQL on
<productname>Windows</productname>. The simplest way to build with
- Microsoft tools is to install <productname>Visual Studio Express 2015
+ Microsoft tools is to install <productname>Visual Studio Express 2017
for Windows Desktop</productname> and use the included
compiler. It is also possible to build with the full
- <productname>Microsoft Visual C++ 2005 to 2015</productname>.
+ <productname>Microsoft Visual C++ 2005 to 2017</productname>.
In some cases that requires the installation of the
<productname>Windows SDK</productname> in addition to the compiler.
</para>
@@ -69,19 +69,19 @@
<productname>Visual Studio Express</productname> or some versions of the
<productname>Microsoft Windows SDK</productname>. If you do not already have a
<productname>Visual Studio</productname> environment set up, the easiest
- ways are to use the compilers from <productname>Visual Studio Express 2015
+ ways are to use the compilers from <productname>Visual Studio Express 2017
for Windows Desktop</productname> or those in the <productname>Windows SDK
- 7.1</productname>, which are both free downloads from Microsoft.
+ 8.1</productname>, which are both free downloads from Microsoft.
</para>
<para>
Both 32-bit and 64-bit builds are possible with the Microsoft Compiler suite.
32-bit PostgreSQL builds are possible with
<productname>Visual Studio 2005</productname> to
- <productname>Visual Studio 2015</productname> (including Express editions),
- as well as standalone Windows SDK releases 6.0 to 7.1.
+ <productname>Visual Studio 2017</productname> (including Express editions),
+ as well as standalone Windows SDK releases 6.0 to 8.1.
64-bit PostgreSQL builds are supported with
- <productname>Microsoft Windows SDK</productname> version 6.0a to 7.1 or
+ <productname>Microsoft Windows SDK</productname> version 6.0a to 8.1 or
<productname>Visual Studio 2008</productname> and above. Compilation
is supported down to <productname>Windows XP</productname> and
<productname>Windows Server 2003</> when building with
@@ -89,6 +89,8 @@
<productname>Visual Studio 2013</productname>. Building with
<productname>Visual Studio 2015</productname> is supported down to
<productname>Windows Vista</> and <productname>Windows Server 2008</>.
+ Building with <productname>Visual Studio 2017</productname> is supported
+ down to <productname>Windows 7 SP1</> and <productname>Windows Server 2012 R2</>.
</para>
<para>
diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm
index d7638b4..074c77e 100644
--- a/src/tools/msvc/MSBuildProject.pm
+++ b/src/tools/msvc/MSBuildProject.pm
@@ -488,4 +488,27 @@ sub new
return $self;
}
+package VC2017Project;
+
+#
+# Package that encapsulates a Visual C++ 2017 project file
+#
+
+use strict;
+use warnings;
+use base qw(VC2012Project);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{vcver} = '14.10';
+ $self->{PlatformToolset} = 'v141';
+ $self->{ToolsVersion} = '14.1';
+
+ return $self;
+}
+
1;
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 7d6275e..909771b 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -817,6 +817,32 @@ sub new
return $self;
}
+package VS2017Solution;
+
+#
+# Package that encapsulates a Visual Studio 2017 solution file
+#
+
+use Carp;
+use strict;
+use warnings;
+use base qw(Solution);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{solutionFileVersion} = '12.00';
+ $self->{vcver} = '14.10';
+ $self->{visualStudioName} = 'Visual Studio 2017';
+ $self->{VisualStudioVersion} = '14.10.25019.0';
+ $self->{MinimumVisualStudioVersion} = '10.0.40219.1';
+
+ return $self;
+}
+
sub GetAdditionalHeaders
{
my ($self, $f) = @_;
diff --git a/src/tools/msvc/VSObjectFactory.pm b/src/tools/msvc/VSObjectFactory.pm
index 4190ada..eb1095b 100644
--- a/src/tools/msvc/VSObjectFactory.pm
+++ b/src/tools/msvc/VSObjectFactory.pm
@@ -53,8 +53,13 @@ sub CreateSolution
{
return new VS2015Solution(@_);
}
+ elsif ($visualStudioVersion eq '14.10')
+ {
+ return new VS2017Solution(@_);
+ }
else
{
+ croak $visualStudioVersion;
croak "The requested Visual Studio version is not supported.";
}
}
@@ -92,6 +97,10 @@ sub CreateProject
{
return new VC2015Project(@_);
}
+ elsif ($visualStudioVersion eq '14.10')
+ {
+ return new VC2017Project(@_);
+ }
else
{
croak "The requested Visual Studio version is not supported.";
Hi
I’ve noticed src/tools/msvc/README also needs some fix together with your patch.
README discription haven’t updated since VS 2012.
Regards
Ideriha, Takeshi
From: pgsql-hackers-owner@postgresql.org [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Haribabu Kommi
Sent: Monday, April 24, 2017 1:24 PM
To: pgsql-hackers@postgresql.org
Subject: [HACKERS] visual studio 2017 build support
Here I attached a small patch that adds the build support for
visual studio 2017.
The tools version number is still 14.X, irrespective of VS 2017
version of 15.0. I modified the versions accordingly.
Regards,
Hari Babu
Fujitsu Australia
On Mon, Apr 24, 2017 at 5:50 PM, Ideriha, Takeshi <
ideriha.takeshi@jp.fujitsu.com> wrote:
Hi
I’ve noticed src/tools/msvc/README also needs some fix together with your
patch.README discription haven’t updated since VS 2012.
Thanks for the review. Here I attached an updated patch with README update.
Regards,
Hari Babu
Fujitsu Australia
Attachments:
0001-VS-2017-build-support-to-PostgreSQL.patchapplication/octet-stream; name=0001-VS-2017-build-support-to-PostgreSQL.patchDownload
From e51faee968a74a0c794542615f4053ffd50f0f97 Mon Sep 17 00:00:00 2001
From: Hari Babu <haribabuk@fast.au.fujitsu.com>
Date: Wed, 21 Jun 2017 09:59:49 +1000
Subject: [PATCH] VS 2017 build support to PostgreSQL
---
doc/src/sgml/install-windows.sgml | 16 +++++++++-------
src/tools/msvc/MSBuildProject.pm | 23 +++++++++++++++++++++++
src/tools/msvc/README | 13 +++++++------
src/tools/msvc/Solution.pm | 26 ++++++++++++++++++++++++++
src/tools/msvc/VSObjectFactory.pm | 9 +++++++++
5 files changed, 74 insertions(+), 13 deletions(-)
diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index f5dfb91..540c945 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -19,10 +19,10 @@
<para>
There are several different ways of building PostgreSQL on
<productname>Windows</productname>. The simplest way to build with
- Microsoft tools is to install <productname>Visual Studio Express 2015
+ Microsoft tools is to install <productname>Visual Studio Express 2017
for Windows Desktop</productname> and use the included
compiler. It is also possible to build with the full
- <productname>Microsoft Visual C++ 2005 to 2015</productname>.
+ <productname>Microsoft Visual C++ 2005 to 2017</productname>.
In some cases that requires the installation of the
<productname>Windows SDK</productname> in addition to the compiler.
</para>
@@ -69,19 +69,19 @@
<productname>Visual Studio Express</productname> or some versions of the
<productname>Microsoft Windows SDK</productname>. If you do not already have a
<productname>Visual Studio</productname> environment set up, the easiest
- ways are to use the compilers from <productname>Visual Studio Express 2015
+ ways are to use the compilers from <productname>Visual Studio Express 2017
for Windows Desktop</productname> or those in the <productname>Windows SDK
- 7.1</productname>, which are both free downloads from Microsoft.
+ 8.1</productname>, which are both free downloads from Microsoft.
</para>
<para>
Both 32-bit and 64-bit builds are possible with the Microsoft Compiler suite.
32-bit PostgreSQL builds are possible with
<productname>Visual Studio 2005</productname> to
- <productname>Visual Studio 2015</productname> (including Express editions),
- as well as standalone Windows SDK releases 6.0 to 7.1.
+ <productname>Visual Studio 2017</productname> (including Express editions),
+ as well as standalone Windows SDK releases 6.0 to 8.1.
64-bit PostgreSQL builds are supported with
- <productname>Microsoft Windows SDK</productname> version 6.0a to 7.1 or
+ <productname>Microsoft Windows SDK</productname> version 6.0a to 8.1 or
<productname>Visual Studio 2008</productname> and above. Compilation
is supported down to <productname>Windows XP</productname> and
<productname>Windows Server 2003</> when building with
@@ -89,6 +89,8 @@
<productname>Visual Studio 2013</productname>. Building with
<productname>Visual Studio 2015</productname> is supported down to
<productname>Windows Vista</> and <productname>Windows Server 2008</>.
+ Building with <productname>Visual Studio 2017</productname> is supported
+ down to <productname>Windows 7 SP1</> and <productname>Windows Server 2012 R2</>.
</para>
<para>
diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm
index d7638b4..074c77e 100644
--- a/src/tools/msvc/MSBuildProject.pm
+++ b/src/tools/msvc/MSBuildProject.pm
@@ -488,4 +488,27 @@ sub new
return $self;
}
+package VC2017Project;
+
+#
+# Package that encapsulates a Visual C++ 2017 project file
+#
+
+use strict;
+use warnings;
+use base qw(VC2012Project);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{vcver} = '14.10';
+ $self->{PlatformToolset} = 'v141';
+ $self->{ToolsVersion} = '14.1';
+
+ return $self;
+}
+
1;
diff --git a/src/tools/msvc/README b/src/tools/msvc/README
index b61ddb8..48082ca 100644
--- a/src/tools/msvc/README
+++ b/src/tools/msvc/README
@@ -4,7 +4,7 @@ MSVC build
==========
This directory contains the tools required to build PostgreSQL using
-Microsoft Visual Studio 2005 - 2011. This builds the whole backend, not just
+Microsoft Visual Studio 2005 - 2017. This builds the whole backend, not just
the libpq frontend library. For more information, see the documentation
chapter "Installation on Windows" and the description below.
@@ -92,11 +92,12 @@ These configuration arguments are passed over to Mkvcbuild::mkvcbuild
(Mkvcbuild.pm) which creates the Visual Studio project and solution files.
It does this by using VSObjectFactory::CreateSolution to create an object
implementing the Solution interface (this could be either a VS2005Solution,
-a VS2008Solution, a VS2010Solution or a VS2012Solution, all in Solution.pm,
-depending on the user's build environment) and adding objects implementing
-the corresponding Project interface (VC2005Project or VC2008Project from
-VCBuildProject.pm or VC2010Project or VC2012Project from MSBuildProject.pm)
-to it.
+a VS2008Solution, a VS2010Solution or a VS2012Solution or a VS2013Solution,
+or a VS2015Solution or a VS2017Solution, all in Solution.pm, depending on
+the user's build environment) and adding objects implementing the corresponding
+Project interface (VC2005Project or VC2008Project from VCBuildProject.pm or
+VC2010Project or VC2012Project or VC2013Project or VC2015Project or VC2017Project
+from MSBuildProject.pm) to it.
When Solution::Save is called, the implementations of Solution and Project
save their content in the appropriate format.
The final step of starting the appropriate build program (msbuild or vcbuild)
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index fc71ebe..f2cbbb7 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -851,6 +851,32 @@ sub new
return $self;
}
+package VS2017Solution;
+
+#
+# Package that encapsulates a Visual Studio 2017 solution file
+#
+
+use Carp;
+use strict;
+use warnings;
+use base qw(Solution);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{solutionFileVersion} = '12.00';
+ $self->{vcver} = '14.10';
+ $self->{visualStudioName} = 'Visual Studio 2017';
+ $self->{VisualStudioVersion} = '14.10.25019.0';
+ $self->{MinimumVisualStudioVersion} = '10.0.40219.1';
+
+ return $self;
+}
+
sub GetAdditionalHeaders
{
my ($self, $f) = @_;
diff --git a/src/tools/msvc/VSObjectFactory.pm b/src/tools/msvc/VSObjectFactory.pm
index 4190ada..eb1095b 100644
--- a/src/tools/msvc/VSObjectFactory.pm
+++ b/src/tools/msvc/VSObjectFactory.pm
@@ -53,8 +53,13 @@ sub CreateSolution
{
return new VS2015Solution(@_);
}
+ elsif ($visualStudioVersion eq '14.10')
+ {
+ return new VS2017Solution(@_);
+ }
else
{
+ croak $visualStudioVersion;
croak "The requested Visual Studio version is not supported.";
}
}
@@ -92,6 +97,10 @@ sub CreateProject
{
return new VC2015Project(@_);
}
+ elsif ($visualStudioVersion eq '14.10')
+ {
+ return new VC2017Project(@_);
+ }
else
{
croak "The requested Visual Studio version is not supported.";
--
2.7.4.windows.1
* On 2017-06-21 02:06, Haribabu Kommi wrote:
Thanks for the review. Here I attached an updated patch with README update.
Hello,
the most recent update to VS 2017, version 15.3, now identifies as
"14.11" rather than "14.10" in the output of nmake /?. Simply adding
this value to the two places that check for 14.10 in your patch appears
to work for me.
In a newly created project, PlatformToolset is still "v141".
ToolsVersion is "15.0" whereas your patch uses "14.1".
ISTM that the ToolsVersion has been like this in all versions of VS
2017; in my collection of .vcxproj files the auto-generated PostgreSQL
projects are the only ones using "14.1".
The build is successful with either value.
I think there was some discussion on this topic, but I cannot find it in
the archives. If there was, I certainly don't want to reopen any
discussions.
All the best,
--
Christian
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Fri, Aug 25, 2017 at 11:27 PM, Christian Ullrich <chris@chrullrich.net>
wrote:
* On 2017-06-21 02:06, Haribabu Kommi wrote:
Thanks for the review. Here I attached an updated patch with README update.
Hello,
Thanks for the review.
the most recent update to VS 2017, version 15.3, now identifies as "14.11"
rather than "14.10" in the output of nmake /?. Simply adding this value to
the two places that check for 14.10 in your patch appears to work for me.
VS 2017 doesn't change the nmake version to 15, and it is updating with
every minor version, so I changed the check to accept
everything that is greater than 14.10 and eq 15, in case in future if VS
2017 changes the version number.
In a newly created project, PlatformToolset is still "v141". ToolsVersion
is "15.0" whereas your patch uses "14.1".ISTM that the ToolsVersion has been like this in all versions of VS 2017;
in my collection of .vcxproj files the auto-generated PostgreSQL projects
are the only ones using "14.1".
Updated the Tools version to 15.0 and kept the platform toolset as V141,
this because the toolset is version is still points
to V141, when I create a sample project with VS 2017 and the version number
is inline with nmake version also.
Regards,
Hari Babu
Fujitsu Australia
Attachments:
0001-vs-2017-support_v2.patchapplication/octet-stream; name=0001-vs-2017-support_v2.patchDownload
From 1590b1f0139196dc818e5856d3aa6f1e58d3445c Mon Sep 17 00:00:00 2001
From: Hari <haribabuk@fast.au.fujitsu.com>
Date: Tue, 22 Aug 2017 10:51:26 +1000
Subject: [PATCH] vs 2017 support
---
doc/src/sgml/install-windows.sgml | 16 +++++++++-------
src/tools/msvc/MSBuildProject.pm | 23 +++++++++++++++++++++++
src/tools/msvc/README | 13 +++++++------
src/tools/msvc/Solution.pm | 26 ++++++++++++++++++++++++++
src/tools/msvc/VSObjectFactory.pm | 13 +++++++++++++
5 files changed, 78 insertions(+), 13 deletions(-)
diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index 1861e7e..b4c403a 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -19,10 +19,10 @@
<para>
There are several different ways of building PostgreSQL on
<productname>Windows</productname>. The simplest way to build with
- Microsoft tools is to install <productname>Visual Studio Express 2015
+ Microsoft tools is to install <productname>Visual Studio Express 2017
for Windows Desktop</productname> and use the included
compiler. It is also possible to build with the full
- <productname>Microsoft Visual C++ 2005 to 2015</productname>.
+ <productname>Microsoft Visual C++ 2005 to 2017</productname>.
In some cases that requires the installation of the
<productname>Windows SDK</productname> in addition to the compiler.
</para>
@@ -69,19 +69,19 @@
<productname>Visual Studio Express</productname> or some versions of the
<productname>Microsoft Windows SDK</productname>. If you do not already have a
<productname>Visual Studio</productname> environment set up, the easiest
- ways are to use the compilers from <productname>Visual Studio Express 2015
+ ways are to use the compilers from <productname>Visual Studio Express 2017
for Windows Desktop</productname> or those in the <productname>Windows SDK
- 7.1</productname>, which are both free downloads from Microsoft.
+ 8.1</productname>, which are both free downloads from Microsoft.
</para>
<para>
Both 32-bit and 64-bit builds are possible with the Microsoft Compiler suite.
32-bit PostgreSQL builds are possible with
<productname>Visual Studio 2005</productname> to
- <productname>Visual Studio 2015</productname> (including Express editions),
- as well as standalone Windows SDK releases 6.0 to 7.1.
+ <productname>Visual Studio 2017</productname> (including Express editions),
+ as well as standalone Windows SDK releases 6.0 to 8.1.
64-bit PostgreSQL builds are supported with
- <productname>Microsoft Windows SDK</productname> version 6.0a to 7.1 or
+ <productname>Microsoft Windows SDK</productname> version 6.0a to 8.1 or
<productname>Visual Studio 2008</productname> and above. Compilation
is supported down to <productname>Windows XP</productname> and
<productname>Windows Server 2003</> when building with
@@ -89,6 +89,8 @@
<productname>Visual Studio 2013</productname>. Building with
<productname>Visual Studio 2015</productname> is supported down to
<productname>Windows Vista</> and <productname>Windows Server 2008</>.
+ Building with <productname>Visual Studio 2017</productname> is supported
+ down to <productname>Windows 7 SP1</> and <productname>Windows Server 2012 R2</>.
</para>
<para>
diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm
index 27329f9..7a287bd 100644
--- a/src/tools/msvc/MSBuildProject.pm
+++ b/src/tools/msvc/MSBuildProject.pm
@@ -483,4 +483,27 @@ sub new
return $self;
}
+package VC2017Project;
+
+#
+# Package that encapsulates a Visual C++ 2017 project file
+#
+
+use strict;
+use warnings;
+use base qw(VC2012Project);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{vcver} = '15.00';
+ $self->{PlatformToolset} = 'v141';
+ $self->{ToolsVersion} = '15.0';
+
+ return $self;
+}
+
1;
diff --git a/src/tools/msvc/README b/src/tools/msvc/README
index b61ddb8..48082ca 100644
--- a/src/tools/msvc/README
+++ b/src/tools/msvc/README
@@ -4,7 +4,7 @@ MSVC build
==========
This directory contains the tools required to build PostgreSQL using
-Microsoft Visual Studio 2005 - 2011. This builds the whole backend, not just
+Microsoft Visual Studio 2005 - 2017. This builds the whole backend, not just
the libpq frontend library. For more information, see the documentation
chapter "Installation on Windows" and the description below.
@@ -92,11 +92,12 @@ These configuration arguments are passed over to Mkvcbuild::mkvcbuild
(Mkvcbuild.pm) which creates the Visual Studio project and solution files.
It does this by using VSObjectFactory::CreateSolution to create an object
implementing the Solution interface (this could be either a VS2005Solution,
-a VS2008Solution, a VS2010Solution or a VS2012Solution, all in Solution.pm,
-depending on the user's build environment) and adding objects implementing
-the corresponding Project interface (VC2005Project or VC2008Project from
-VCBuildProject.pm or VC2010Project or VC2012Project from MSBuildProject.pm)
-to it.
+a VS2008Solution, a VS2010Solution or a VS2012Solution or a VS2013Solution,
+or a VS2015Solution or a VS2017Solution, all in Solution.pm, depending on
+the user's build environment) and adding objects implementing the corresponding
+Project interface (VC2005Project or VC2008Project from VCBuildProject.pm or
+VC2010Project or VC2012Project or VC2013Project or VC2015Project or VC2017Project
+from MSBuildProject.pm) to it.
When Solution::Save is called, the implementations of Solution and Project
save their content in the appropriate format.
The final step of starting the appropriate build program (msbuild or vcbuild)
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 01e5846..dba6327 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -851,6 +851,32 @@ sub new
return $self;
}
+package VS2017Solution;
+
+#
+# Package that encapsulates a Visual Studio 2017 solution file
+#
+
+use Carp;
+use strict;
+use warnings;
+use base qw(Solution);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{solutionFileVersion} = '12.00';
+ $self->{vcver} = '15.00';
+ $self->{visualStudioName} = 'Visual Studio 2017';
+ $self->{VisualStudioVersion} = '15.0.26730.3';
+ $self->{MinimumVisualStudioVersion} = '10.0.40219.1';
+
+ return $self;
+}
+
sub GetAdditionalHeaders
{
my ($self, $f) = @_;
diff --git a/src/tools/msvc/VSObjectFactory.pm b/src/tools/msvc/VSObjectFactory.pm
index 4190ada..2f3480a 100644
--- a/src/tools/msvc/VSObjectFactory.pm
+++ b/src/tools/msvc/VSObjectFactory.pm
@@ -53,8 +53,14 @@ sub CreateSolution
{
return new VS2015Solution(@_);
}
+ # visual 2017 hasn't changed the nmake version to 15, so adjust the check to support it.
+ elsif (($visualStudioVersion ge '14.10') or ($visualStudioVersion eq '15.00'))
+ {
+ return new VS2017Solution(@_);
+ }
else
{
+ croak $visualStudioVersion;
croak "The requested Visual Studio version is not supported.";
}
}
@@ -92,8 +98,14 @@ sub CreateProject
{
return new VC2015Project(@_);
}
+ # visual 2017 hasn't changed the nmake version to 15, so adjust the check to support it.
+ elsif (($visualStudioVersion ge '14.10') or ($visualStudioVersion eq '15.00'))
+ {
+ return new VC2017Project(@_);
+ }
else
{
+ croak $visualStudioVersion;
croak "The requested Visual Studio version is not supported.";
}
}
@@ -120,6 +132,7 @@ sub DetermineVisualStudioVersion
sub _GetVisualStudioVersion
{
my ($major, $minor) = @_;
+ # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
if ($major > 14)
{
carp
--
2.7.4.windows.1
On 08/25/2017 11:29 PM, Haribabu Kommi wrote:
On Fri, Aug 25, 2017 at 11:27 PM, Christian Ullrich
<chris@chrullrich.net <mailto:chris@chrullrich.net>> wrote:* On 2017-06-21 02:06, Haribabu Kommi wrote:
Thanks for the review. Here I attached an updated patch with
README update.Hello,
Thanks for the review.
the most recent update to VS 2017, version 15.3, now identifies as
"14.11" rather than "14.10" in the output of nmake /?. Simply
adding this value to the two places that check for 14.10 in your
patch appears to work for me.VS 2017 doesn't change the nmake version to 15, and it is updating
with every minor version, so I changed the check to accept
everything that is greater than 14.10 and eq 15, in case in future if
VS 2017 changes the version number.
In a newly created project, PlatformToolset is still "v141".
ToolsVersion is "15.0" whereas your patch uses "14.1".ISTM that the ToolsVersion has been like this in all versions of
VS 2017; in my collection of .vcxproj files the auto-generated
PostgreSQL projects are the only ones using "14.1".
Updated the Tools version to 15.0 and kept the platform toolset as
V141, this because the toolset is version is still points
to V141, when I create a sample project with VS 2017 and the version
number is inline with nmake version also.
I was about to commit this after a good bit of testing when I noticed this:
+ Building with <productname>Visual Studio 2017</productname> is
supported
+ down to <productname>Windows 7 SP1</> and <productname>Windows
Server 2012 R2</>.
I was able to build on Windows Server 2008 without a problem, so I'm
curious why we are saying it's not supported.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Fri, Sep 22, 2017 at 7:03 AM, Andrew Dunstan <
andrew.dunstan@2ndquadrant.com> wrote:
On 08/25/2017 11:29 PM, Haribabu Kommi wrote:
On Fri, Aug 25, 2017 at 11:27 PM, Christian Ullrich
<chris@chrullrich.net <mailto:chris@chrullrich.net>> wrote:* On 2017-06-21 02:06, Haribabu Kommi wrote:
Thanks for the review. Here I attached an updated patch with
README update.Hello,
Thanks for the review.
the most recent update to VS 2017, version 15.3, now identifies as
"14.11" rather than "14.10" in the output of nmake /?. Simply
adding this value to the two places that check for 14.10 in your
patch appears to work for me.VS 2017 doesn't change the nmake version to 15, and it is updating
with every minor version, so I changed the check to accept
everything that is greater than 14.10 and eq 15, in case in future if
VS 2017 changes the version number.In a newly created project, PlatformToolset is still "v141".
ToolsVersion is "15.0" whereas your patch uses "14.1".ISTM that the ToolsVersion has been like this in all versions of
VS 2017; in my collection of .vcxproj files the auto-generated
PostgreSQL projects are the only ones using "14.1".Updated the Tools version to 15.0 and kept the platform toolset as
V141, this because the toolset is version is still points
to V141, when I create a sample project with VS 2017 and the version
number is inline with nmake version also.I was about to commit this after a good bit of testing when I noticed this:
+ Building with <productname>Visual Studio 2017</productname> is supported + down to <productname>Windows 7 SP1</> and <productname>Windows Server 2012 R2</>.I was able to build on Windows Server 2008 without a problem, so I'm
curious why we are saying it's not supported.
Thanks for the review.
From the visual studio system requirements [1]https://www.visualstudio.com/en-us/productinfo/vs2017-system-requirements-vs, in the section of supported
operating systems, it is mentioned as windows 7 SP1 and windows server
2012 R2 and didn't mentioned anything about 2008, because of this reason,
I mentioned as that it supported till the above operating systems. As I
don't
have windows server 2008 system availability, so I didn't verify the same.
The visual studio 2017 product itself is not mentioned as that it supports
windows server 2008, can we go ahead and mention it in our documentation?
[1]: https://www.visualstudio.com/en-us/productinfo/vs2017-system-requirements-vs
https://www.visualstudio.com/en-us/productinfo/vs2017-system-requirements-vs
Regards,
Hari Babu
Fujitsu Australia
On 09/21/2017 08:16 PM, Haribabu Kommi wrote:
I was about to commit this after a good bit of testing when I
noticed this:+ Building with <productname>Visual Studio 2017</productname> is
supported
+ down to <productname>Windows 7 SP1</> and <productname>Windows
Server 2012 R2</>.I was able to build on Windows Server 2008 without a problem, so I'm
curious why we are saying it's not supported.Thanks for the review.
From the visual studio system requirements [1], in the section of
supported
operating systems, it is mentioned as windows 7 SP1 and windows server
2012 R2 and didn't mentioned anything about 2008, because of this reason,
I mentioned as that it supported till the above operating systems. As
I don't
have windows server 2008 system availability, so I didn't verify the same.The visual studio 2017 product itself is not mentioned as that it supports
windows server 2008, can we go ahead and mention it in our documentation?[1] -
https://www.visualstudio.com/en-us/productinfo/vs2017-system-requirements-vs
That page also says:
Microsoft Visual Studio Build Tools 2017
Also installs on Windows Server 2008 R2 SP1
So I'm inclined to adjust the documentation accordingly.
cheers
andrew
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Fri, Sep 22, 2017 at 10:40 PM, Andrew Dunstan <
andrew.dunstan@2ndquadrant.com> wrote:
On 09/21/2017 08:16 PM, Haribabu Kommi wrote:
I was about to commit this after a good bit of testing when I
noticed this:+ Building with <productname>Visual Studio 2017</productname>
is
supported
+ down to <productname>Windows 7 SP1</> and<productname>Windows
Server 2012 R2</>.
I was able to build on Windows Server 2008 without a problem, so I'm
curious why we are saying it's not supported.Thanks for the review.
From the visual studio system requirements [1], in the section of
supported
operating systems, it is mentioned as windows 7 SP1 and windows server
2012 R2 and didn't mentioned anything about 2008, because of this reason,
I mentioned as that it supported till the above operating systems. As
I don't
have windows server 2008 system availability, so I didn't verify thesame.
The visual studio 2017 product itself is not mentioned as that it
supports
windows server 2008, can we go ahead and mention it in our documentation?
system-requirements-vs
That page also says:
Microsoft Visual Studio Build Tools 2017
Also installs on Windows Server 2008 R2 SP1
So I'm inclined to adjust the documentation accordingly.
Thanks for pointing it out, I missed to check the Build tools support
section.
Here I attached the updated patch with the change in documentation to
include the 2008 R2 SP1 operating system also.
Regards,
Hari Babu
Fujitsu Australia
Attachments:
0001-Support-of-PostgreSQL-build-with-visual-studio-2017_v3.patchapplication/octet-stream; name=0001-Support-of-PostgreSQL-build-with-visual-studio-2017_v3.patchDownload
From 00c68180c6abeaaf27e99a01b57014cd9c214b98 Mon Sep 17 00:00:00 2001
From: Hari <haribabuk@fast.au.fujitsu.com>
Date: Tue, 22 Aug 2017 10:51:26 +1000
Subject: [PATCH] Support of PostgreSQL build with visual studio 2017
---
doc/src/sgml/install-windows.sgml | 16 +++++++++-------
src/tools/msvc/MSBuildProject.pm | 23 +++++++++++++++++++++++
src/tools/msvc/README | 13 +++++++------
src/tools/msvc/Solution.pm | 26 ++++++++++++++++++++++++++
src/tools/msvc/VSObjectFactory.pm | 13 +++++++++++++
5 files changed, 78 insertions(+), 13 deletions(-)
diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index 1861e7e..696c620 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -19,10 +19,10 @@
<para>
There are several different ways of building PostgreSQL on
<productname>Windows</productname>. The simplest way to build with
- Microsoft tools is to install <productname>Visual Studio Express 2015
+ Microsoft tools is to install <productname>Visual Studio Express 2017
for Windows Desktop</productname> and use the included
compiler. It is also possible to build with the full
- <productname>Microsoft Visual C++ 2005 to 2015</productname>.
+ <productname>Microsoft Visual C++ 2005 to 2017</productname>.
In some cases that requires the installation of the
<productname>Windows SDK</productname> in addition to the compiler.
</para>
@@ -69,19 +69,19 @@
<productname>Visual Studio Express</productname> or some versions of the
<productname>Microsoft Windows SDK</productname>. If you do not already have a
<productname>Visual Studio</productname> environment set up, the easiest
- ways are to use the compilers from <productname>Visual Studio Express 2015
+ ways are to use the compilers from <productname>Visual Studio Express 2017
for Windows Desktop</productname> or those in the <productname>Windows SDK
- 7.1</productname>, which are both free downloads from Microsoft.
+ 8.1</productname>, which are both free downloads from Microsoft.
</para>
<para>
Both 32-bit and 64-bit builds are possible with the Microsoft Compiler suite.
32-bit PostgreSQL builds are possible with
<productname>Visual Studio 2005</productname> to
- <productname>Visual Studio 2015</productname> (including Express editions),
- as well as standalone Windows SDK releases 6.0 to 7.1.
+ <productname>Visual Studio 2017</productname> (including Express editions),
+ as well as standalone Windows SDK releases 6.0 to 8.1.
64-bit PostgreSQL builds are supported with
- <productname>Microsoft Windows SDK</productname> version 6.0a to 7.1 or
+ <productname>Microsoft Windows SDK</productname> version 6.0a to 8.1 or
<productname>Visual Studio 2008</productname> and above. Compilation
is supported down to <productname>Windows XP</productname> and
<productname>Windows Server 2003</> when building with
@@ -89,6 +89,8 @@
<productname>Visual Studio 2013</productname>. Building with
<productname>Visual Studio 2015</productname> is supported down to
<productname>Windows Vista</> and <productname>Windows Server 2008</>.
+ Building with <productname>Visual Studio 2017</productname> is supported
+ down to <productname>Windows 7 SP1</> and <productname>Windows Server 2008 R2 SP1</>.
</para>
<para>
diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm
index 27329f9..7a287bd 100644
--- a/src/tools/msvc/MSBuildProject.pm
+++ b/src/tools/msvc/MSBuildProject.pm
@@ -483,4 +483,27 @@ sub new
return $self;
}
+package VC2017Project;
+
+#
+# Package that encapsulates a Visual C++ 2017 project file
+#
+
+use strict;
+use warnings;
+use base qw(VC2012Project);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{vcver} = '15.00';
+ $self->{PlatformToolset} = 'v141';
+ $self->{ToolsVersion} = '15.0';
+
+ return $self;
+}
+
1;
diff --git a/src/tools/msvc/README b/src/tools/msvc/README
index b61ddb8..48082ca 100644
--- a/src/tools/msvc/README
+++ b/src/tools/msvc/README
@@ -4,7 +4,7 @@ MSVC build
==========
This directory contains the tools required to build PostgreSQL using
-Microsoft Visual Studio 2005 - 2011. This builds the whole backend, not just
+Microsoft Visual Studio 2005 - 2017. This builds the whole backend, not just
the libpq frontend library. For more information, see the documentation
chapter "Installation on Windows" and the description below.
@@ -92,11 +92,12 @@ These configuration arguments are passed over to Mkvcbuild::mkvcbuild
(Mkvcbuild.pm) which creates the Visual Studio project and solution files.
It does this by using VSObjectFactory::CreateSolution to create an object
implementing the Solution interface (this could be either a VS2005Solution,
-a VS2008Solution, a VS2010Solution or a VS2012Solution, all in Solution.pm,
-depending on the user's build environment) and adding objects implementing
-the corresponding Project interface (VC2005Project or VC2008Project from
-VCBuildProject.pm or VC2010Project or VC2012Project from MSBuildProject.pm)
-to it.
+a VS2008Solution, a VS2010Solution or a VS2012Solution or a VS2013Solution,
+or a VS2015Solution or a VS2017Solution, all in Solution.pm, depending on
+the user's build environment) and adding objects implementing the corresponding
+Project interface (VC2005Project or VC2008Project from VCBuildProject.pm or
+VC2010Project or VC2012Project or VC2013Project or VC2015Project or VC2017Project
+from MSBuildProject.pm) to it.
When Solution::Save is called, the implementations of Solution and Project
save their content in the appropriate format.
The final step of starting the appropriate build program (msbuild or vcbuild)
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 5d5f716..0925bef 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -849,6 +849,32 @@ sub new
return $self;
}
+package VS2017Solution;
+
+#
+# Package that encapsulates a Visual Studio 2017 solution file
+#
+
+use Carp;
+use strict;
+use warnings;
+use base qw(Solution);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{solutionFileVersion} = '12.00';
+ $self->{vcver} = '15.00';
+ $self->{visualStudioName} = 'Visual Studio 2017';
+ $self->{VisualStudioVersion} = '15.0.26730.3';
+ $self->{MinimumVisualStudioVersion} = '10.0.40219.1';
+
+ return $self;
+}
+
sub GetAdditionalHeaders
{
my ($self, $f) = @_;
diff --git a/src/tools/msvc/VSObjectFactory.pm b/src/tools/msvc/VSObjectFactory.pm
index 4190ada..2f3480a 100644
--- a/src/tools/msvc/VSObjectFactory.pm
+++ b/src/tools/msvc/VSObjectFactory.pm
@@ -53,8 +53,14 @@ sub CreateSolution
{
return new VS2015Solution(@_);
}
+ # visual 2017 hasn't changed the nmake version to 15, so adjust the check to support it.
+ elsif (($visualStudioVersion ge '14.10') or ($visualStudioVersion eq '15.00'))
+ {
+ return new VS2017Solution(@_);
+ }
else
{
+ croak $visualStudioVersion;
croak "The requested Visual Studio version is not supported.";
}
}
@@ -92,8 +98,14 @@ sub CreateProject
{
return new VC2015Project(@_);
}
+ # visual 2017 hasn't changed the nmake version to 15, so adjust the check to support it.
+ elsif (($visualStudioVersion ge '14.10') or ($visualStudioVersion eq '15.00'))
+ {
+ return new VC2017Project(@_);
+ }
else
{
+ croak $visualStudioVersion;
croak "The requested Visual Studio version is not supported.";
}
}
@@ -120,6 +132,7 @@ sub DetermineVisualStudioVersion
sub _GetVisualStudioVersion
{
my ($major, $minor) = @_;
+ # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
if ($major > 14)
{
carp
--
1.8.3.1
On 09/25/2017 12:25 AM, Haribabu Kommi wrote:
Thanks for pointing it out, I missed to check the Build tools support
section.
Here I attached the updated patch with the change in documentation to
include the 2008 R2 SP1 operating system also.
Thanks, committed and backpatched to 9.6 It would be nice to get
buildfarm members going supporting VS2015 and VS2017
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Mon, Sep 25, 2017 at 10:12 PM, Andrew Dunstan <
andrew.dunstan@2ndquadrant.com> wrote:
On 09/25/2017 12:25 AM, Haribabu Kommi wrote:
Thanks for pointing it out, I missed to check the Build tools support
section.
Here I attached the updated patch with the change in documentation to
include the 2008 R2 SP1 operating system also.Thanks, committed and backpatched to 9.6 It would be nice to get
buildfarm members going supporting VS2015 and VS2017
Thanks.
Regards,
Hari Babu
Fujitsu Australia