Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ce8e49

Browse files
committed
Add support for Visual Studio 2019 in build scripts
This adjusts the documentation and the scripts related to the versionsof Windows SDK supported.Author: Haribabu KommiReviewed-by: Andrew Dunstan, Juan José Santamaría Flecha, MichaelPaquierDiscussion:https://postgr.es/m/CAJrrPGcfqXhfPyMrny9apoDU7M1t59dzVAvoJ9AeAh5BJi+UzA@mail.gmail.comBackpatch-through: 9.4
1 parent90434e6 commit0ce8e49

File tree

5 files changed

+115
-27
lines changed

5 files changed

+115
-27
lines changed

‎doc/src/sgml/install-windows.sgml‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
<para>
2020
There are several different ways of building PostgreSQL on
2121
<productname>Windows</productname>. The simplest way to build with
22-
Microsoft tools is to install <productname>Visual Studio Express2017
22+
Microsoft tools is to install <productname>Visual Studio Express2019
2323
for Windows Desktop</productname> and use the included
2424
compiler. It is also possible to build with the full
25-
<productname>Microsoft Visual C++ 2005 to2017</productname>.
25+
<productname>Microsoft Visual C++ 2005 to2019</productname>.
2626
In some cases that requires the installation of the
2727
<productname>Windows SDK</productname> in addition to the compiler.
2828
</para>
@@ -69,28 +69,29 @@
6969
<productname>Visual Studio Express</productname> or some versions of the
7070
<productname>Microsoft Windows SDK</productname>. If you do not already have a
7171
<productname>Visual Studio</productname> environment set up, the easiest
72-
ways are to use the compilers from <productname>Visual Studio Express2017
72+
ways are to use the compilers from <productname>Visual Studio Express2019
7373
for Windows Desktop</productname> or those in the <productname>Windows SDK
74-
8.1</productname>, which are both free downloads from Microsoft.
74+
10</productname>, which are both free downloads from Microsoft.
7575
</para>
7676

7777
<para>
7878
Both 32-bit and 64-bit builds are possible with the Microsoft Compiler suite.
7979
32-bit PostgreSQL builds are possible with
8080
<productname>Visual Studio 2005</productname> to
81-
<productname>Visual Studio2017</productname> (including Express editions),
82-
as well as standalone Windows SDK releases 6.0 to8.1.
81+
<productname>Visual Studio2019</productname> (including Express editions),
82+
as well as standalone Windows SDK releases 6.0 to10.
8383
64-bit PostgreSQL builds are supported with
84-
<productname>Microsoft Windows SDK</productname> version 6.0a to8.1 or
84+
<productname>Microsoft Windows SDK</productname> version 6.0a to10 or
8585
<productname>Visual Studio 2008</productname> and above. Compilation
8686
is supported down to <productname>Windows XP</productname> and
8787
<productname>Windows Server 2003</> when building with
8888
<productname>Visual Studio 2005</> to
8989
<productname>Visual Studio 2013</productname>. Building with
9090
<productname>Visual Studio 2015</productname> is supported down to
9191
<productname>Windows Vista</> and <productname>Windows Server 2008</>.
92-
Building with <productname>Visual Studio 2017</productname> is supported
93-
down to <productname>Windows 7 SP1</> and <productname>Windows Server 2008 R2 SP1</>.
92+
Building with <productname>Visual Studio 2017</productname> and
93+
<productname>Visual Studio 2019</productname> is supported
94+
down to <productname>Windows 7 SP1</> and <productname>Windows Server 2008 R2 SP1</>.
9495
</para>
9596

9697
<para>
@@ -162,7 +163,7 @@ $ENV{MSBFLAGS}="/m";
162163
If your build environment doesn't ship with a supported version of the
163164
<productname>Microsoft Windows SDK</productname> it
164165
is recommended that you upgrade to the latest version (currently
165-
version7.1), available for download from
166+
version10), available for download from
166167
<ulink url="https://www.microsoft.com/download"></>.
167168
</para>
168169
<para>

‎src/tools/msvc/MSBuildProject.pm‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,4 +508,29 @@ sub new
508508
return$self;
509509
}
510510

511+
packageVC2019Project;
512+
513+
#
514+
# Package that encapsulates a Visual C++ 2019 project file
515+
#
516+
517+
use strict;
518+
use warnings;
519+
use baseqw(VC2012Project);
520+
521+
no warningsqw(redefine);## no critic
522+
523+
subnew
524+
{
525+
my$classname =shift;
526+
my$self =$classname->SUPER::_new(@_);
527+
bless($self,$classname);
528+
529+
$self->{vcver} ='16.00';
530+
$self->{PlatformToolset} ='v142';
531+
$self->{ToolsVersion} ='16.0';
532+
533+
return$self;
534+
}
535+
511536
1;

‎src/tools/msvc/README‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MSVC build
44
==========
55

66
This directory contains the tools required to build PostgreSQL using
7-
Microsoft Visual Studio 2005 -2017. This builds the whole backend, not just
7+
Microsoft Visual Studio 2005 -2019. This builds the whole backend, not just
88
the libpq frontend library. For more information, see the documentation
99
chapter "Installation on Windows" and the description below.
1010

@@ -93,11 +93,12 @@ These configuration arguments are passed over to Mkvcbuild::mkvcbuild
9393
It does this by using VSObjectFactory::CreateSolution to create an object
9494
implementing the Solution interface (this could be either a VS2005Solution,
9595
a VS2008Solution, a VS2010Solution or a VS2012Solution or a VS2013Solution,
96-
or a VS2015Solution or a VS2017Solution, all in Solution.pm, depending on
97-
the user's build environment) and adding objects implementing the corresponding
98-
Project interface (VC2005Project or VC2008Project from VCBuildProject.pm or
99-
VC2010Project or VC2012Project or VC2013Project or VC2015Project or VC2017Project
100-
from MSBuildProject.pm) to it.
96+
or a VS2015Solution or a VS2017Solution or a VS2019Solution, all in
97+
Solution.pm, depending on the user's build environment) and adding objects
98+
implementing the corresponding Project interface (VC2005Project or
99+
VC2008Project from VCBuildProject.pm or VC2010Project or VC2012Project or
100+
VC2013Project or VC2015Project or VC2017Project or VC2019Project from
101+
MSBuildProject.pm) to it.
101102
When Solution::Save is called, the implementations of Solution and Project
102103
save their content in the appropriate format.
103104
The final step of starting the appropriate build program (msbuild or vcbuild)

‎src/tools/msvc/Solution.pm‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,34 @@ sub new
972972
return$self;
973973
}
974974

975+
packageVS2019Solution;
976+
977+
#
978+
# Package that encapsulates a Visual Studio 2019 solution file
979+
#
980+
981+
use Carp;
982+
use strict;
983+
use warnings;
984+
use baseqw(Solution);
985+
986+
no warningsqw(redefine);## no critic
987+
988+
subnew
989+
{
990+
my$classname =shift;
991+
my$self =$classname->SUPER::_new(@_);
992+
bless($self,$classname);
993+
994+
$self->{solutionFileVersion} ='12.00';
995+
$self->{vcver} ='16.00';
996+
$self->{visualStudioName} ='Visual Studio 2019';
997+
$self->{VisualStudioVersion} ='16.0.28729.10';
998+
$self->{MinimumVisualStudioVersion} ='10.0.40219.1';
999+
1000+
return$self;
1001+
}
1002+
9751003
subGetAdditionalHeaders
9761004
{
9771005
my ($self,$f) =@_;

‎src/tools/msvc/VSObjectFactory.pm‎

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,30 @@ sub CreateSolution
5353
{
5454
return new VS2015Solution(@_);
5555
}
56-
# visual 2017 hasn't changed the nmake version to 15, so adjust the check to support it.
57-
elsif (($visualStudioVersionge'14.10')or ($visualStudioVersioneq'15.00'))
56+
57+
# The version of nmake bundled in Visual Studio 2017 is greater
58+
# than 14.10 and less than 14.20. And the version number is
59+
# actually 15.00.
60+
elsif (
61+
($visualStudioVersionge'14.10' &&$visualStudioVersionlt'14.20')
62+
||$visualStudioVersioneq'15.00')
5863
{
5964
return new VS2017Solution(@_);
6065
}
66+
67+
# The version of nmake bundled in Visual Studio 2019 is greater
68+
# than 14.20 and less than 14.30. And the version number is
69+
# actually 16.00.
70+
elsif (
71+
($visualStudioVersionge'14.20' &&$visualStudioVersionlt'14.30')
72+
||$visualStudioVersioneq'16.00')
73+
{
74+
return new VS2019Solution(@_);
75+
}
6176
else
6277
{
63-
croak$visualStudioVersion;
64-
croak"The requested Visual Studio version is not supported.";
78+
croak
79+
"The requested Visual Studio version$visualStudioVersion is not supported.";
6580
}
6681
}
6782

@@ -98,15 +113,30 @@ sub CreateProject
98113
{
99114
return new VC2015Project(@_);
100115
}
101-
# visual 2017 hasn't changed the nmake version to 15, so adjust the check to support it.
102-
elsif (($visualStudioVersionge'14.10')or ($visualStudioVersioneq'15.00'))
116+
117+
# The version of nmake bundled in Visual Studio 2017 is greater
118+
# than 14.10 and less than 14.20. And the version number is
119+
# actually 15.00.
120+
elsif (
121+
($visualStudioVersionge'14.10' &&$visualStudioVersionlt'14.20')
122+
||$visualStudioVersioneq'15.00')
103123
{
104124
return new VC2017Project(@_);
105125
}
126+
127+
# The version of nmake bundled in Visual Studio 2019 is greater
128+
# than 14.20 and less than 14.30. And the version number is
129+
# actually 16.00.
130+
elsif (
131+
($visualStudioVersionge'14.20' &&$visualStudioVersionlt'14.30')
132+
||$visualStudioVersioneq'16.00')
133+
{
134+
return new VC2019Project(@_);
135+
}
106136
else
107137
{
108-
croak$visualStudioVersion;
109-
croak"The requested Visual Studio version is not supported.";
138+
croak
139+
"The requested Visual Studio version$visualStudioVersion is not supported.";
110140
}
111141
}
112142

@@ -132,12 +162,15 @@ sub DetermineVisualStudioVersion
132162
sub_GetVisualStudioVersion
133163
{
134164
my ($major,$minor) =@_;
135-
# visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
136-
if ($major > 14)
165+
166+
# The major visual studio that is supported has nmake
167+
# version <= 14.30, so stick with it as the latest version
168+
# if bumping on something even newer.
169+
if ($major >= 14 &&$minor >= 30)
137170
{
138171
carp
139172
"The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead.";
140-
return'14.00';
173+
return'14.20';
141174
}
142175
elsif ($major < 6)
143176
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp