Skip to content

Commit 2fb865f

Browse files
authored
Merge pull request DOCGroup#146 from mitza-oci/vs2022
Generate Visual Studio 2022 projects and solutions
2 parents 1abb954 + 7ac5f65 commit 2fb865f

File tree

14 files changed

+179
-16
lines changed

14 files changed

+179
-16
lines changed

config/pin_base.mpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ project {
1515
compile_flags += /Oy
1616
}
1717

18-
specific (vc10, vc11, vc12, vc14, vs2017, vs2019) {
18+
specific (prop:microsoft) {
1919
runtime_library = MultiThreaded
2020
ImageHasSafeExceptionHandlers = false
2121

config/pintool.mpb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ feature (ia32) {
4141
link_options += /ENTRY:Ptrace_DllMainCRTStartup@12
4242
}
4343

44-
specific (vc10, vc11, vc12, vc14, vs2017, vs2019) {
44+
specific (prop:microsoft) {
4545
EntryPointSymbol = Ptrace_DllMainCRTStartup@12
4646
}
4747
}
@@ -51,7 +51,7 @@ feature (intel64) {
5151
link_options += /ENTRY:Ptrace_DllMainCRTStartup
5252
}
5353

54-
specific (vc10, vc11, vc12, vc14, vs2017, vs2019) {
54+
specific (prop:microsoft) {
5555
EntryPointSymbol = Ptrace_DllMainCRTStartup
5656
}
5757

config/winapp.mpb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
// -*- MPC -*-
22
project {
3-
specific(em3, nmake, vc6) {
3+
specific(nmake) {
44
subsystem = windows
55
} else {
6-
subsystem = 2
7-
}
8-
specific(vc10, vc11, vc12, vc14, vs2017, vs2019) {
96
subsystem = Windows
107
}
118
}

config/wireshark.mpb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ project : glib {
3232
specific(vs2019) {
3333
macros += MSC_VER_REQUIRED=1920
3434
}
35+
specific(vs2022) {
36+
macros += MSC_VER_REQUIRED=1930
37+
}
3538
verbatim(nmake, top, 1) {
3639
include $(WIRESHARK_SRC)/config.nmake
3740
}
3841
}
3942

4043
// Autoconf / In Source Wireshark Build Method
41-
// This feasture works with how Wireshark Developers Guide says to build
44+
// This feature works with how Wireshark Developers Guide says to build
4245
// Wireshark on Linux (autogen.sh). This is also used for older 1.x Wireshark
4346
// Windows builds and if Wireshark headers are installed on the system.
4447
// On Windows $(WIRETAP_VERSION) also has to be specified as well.

docs/USAGE

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ Usage: mwc.pl [-global <file>] [-include <directory>] [-recurse]
2525
[-language <cplusplus | csharp | java | vb>]
2626
[-type <automake | bcb2007 | bcb2009 | bds4 | bmake | cc | cdt6 |
2727
cdt7 | em3 | ghs | html | iar | make | nmake | rpmspec |
28-
sle | uvis | vc6 | vc7 | vc8 | vc9 | vc10 | vc11 | vc12 |
29-
vc14 | vs2017 | vs2019 | vc71 | wb26 | wb30 | wix>]
28+
sle | uvis | vc6 | vc7 | vc71 | vc8 | vc9 | vc10 | vc11 |
29+
vc12 | vc14 | vs2017 | vs2019 | vs2022 | wb26 | wb30 |
30+
wix>]
3031
[files]
3132

3233
-base Add <project> as a base project to each generated

docs/html/MakeProjectCreator.html

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,18 @@ <h6 class="NumberedTableTitle">MPC Types</h6>
527527
</td>
528528
</tr>
529529

530+
<tr>
531+
<td rowspan="1" colspan="1">
532+
<p class="TblCode">
533+
<em class="TableCode">vs2022</em>
534+
</p>
535+
</td>
536+
537+
<td rowspan="1" colspan="1">
538+
<p class="Tbl-Body">Visual Studio 2022.</p>
539+
</td>
540+
</tr>
541+
530542
<tr>
531543
<td rowspan="1" colspan="1">
532544
<p class="TblCode">
@@ -1838,7 +1850,7 @@ <h4 class="Head3">Environment Variables</h4>
18381850
"Code">vc7</em>, <em class="Code">vc71</em>, <em class="Code">vc8</em>,
18391851
<em class="Code">vc9</em>, <em class="Code">vc10</em>, <em class="Code">vc11</em>,
18401852
<em class="Code">vc12</em>, <em class="Code">vc14</em>,
1841-
<em class="Code">vs2017</em>, and <em class="Code">vs2019</em> project types. If this environment
1853+
and <em class="Code">vs*</em> project types. If this environment
18421854
variable is set, MPC will generate inter-project dependencies for
18431855
libraries within a single workspace. This is usually not desired
18441856
since adding these dependencies in a static workspace has the side
@@ -1994,7 +2006,7 @@ <h5 class="Head4">mwc and mwb files</h5>
19942006

19952007
<p class="Code">
19962008
&nbsp;&nbsp;exclude(vc6, vc7, vc71, vc8, vc9,
1997-
vc10, vc11, vc12, vc14, vs2017, vs2019, nmake) {
2009+
vc10, vc11, vc12, vc14, vs2017, vs2019, vs2022, nmake) {
19982010
</p>
19992011

20002012
<p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;this_directory</p>
@@ -2603,7 +2615,7 @@ <h6 class="NumberedTableTitle">
26032615
<em class="Code">vc10</em>, <em class="Code">vc11</em>,
26042616
<em class="Code">vc12</em>, <em class="Code">vc14</em>,
26052617
<em class="Code">vc12</em>, <em class="Code">vc14</em>,
2606-
<em class="Code">vs2017</em>, and <em class="Code">vs2019</em> project types.
2618+
and <em class="Code">vs*</em> project types.
26072619
</p>
26082620
</td>
26092621
</tr>
@@ -3250,7 +3262,7 @@ <h6 class="NumberedTableTitle">
32503262
"Code">vc7</em>, <em class="Code">vc71</em>, <em class="Code">vc8</em>,
32513263
<em class="Code">vc9</em>, <em class="Code">vc10</em>, <em class="Code">vc11</em>,
32523264
<em class="Code">vc12</em>, <em class="Code">vc14</em>,
3253-
<em class="Code">vs2017</em>, and <em class="Code">vs2019</em> project types.
3265+
and <em class="Code">vs*</em> project types.
32543266
</p>
32553267

32563268
<p class="Body">
@@ -8110,7 +8122,7 @@ <h6 class="NumberedTableTitle">
81108122
7.10 is return for vc71 and 8.00 is returned for vc8,
81118123
9.00 is returned for vc9, 10.00 is returned for vc10,
81128124
11.00 is returned for vc11, 12.0 is returned for vc12,
8113-
14.0 is returned for vc14, 14.1 is returned for vs2017, 14.2 is returned for vs2019.
8125+
14.0 is returned for vc14, 14.1 is returned for vs2017, 14.2 is returned for vs2019, 14.3 is returned for vs2022.
81148126
</p>
81158127
</td>
81168128
</tr>
@@ -8428,7 +8440,7 @@ <h6 class="NumberedTableTitle">Custom Type Fields</h6>
84288440
<p class="Body">
84298441
Certain project types don't support the same
84308442
input file used by multiple custom types (current examples of
8431-
this are vc10, vc11, vc12, vc14, vs2017, vs2019, cdt6, and cdt7). To accommodate these types, MPC
8443+
this are vc10, vc11, vc12, vc14, vs*, cdt6, and cdt7). To accommodate these types, MPC
84328444
has a capability called "combined custom". With this capability
84338445
enabled in the specific ProjectCreator, MPC will "fold together"
84348446
the multiple custom steps so that the target tool (Visual Studio

modules/VS2022ProjectCreator.pm

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package VS2022ProjectCreator;
2+
3+
# ************************************************************
4+
# Description : vs2022 (Visual Studio 2022) Project Creator
5+
# ************************************************************
6+
7+
# ************************************************************
8+
# Pragmas
9+
# ************************************************************
10+
11+
use strict;
12+
13+
use VC12ProjectCreator;
14+
15+
use vars qw(@ISA);
16+
@ISA = qw(VC12ProjectCreator);
17+
18+
## NOTE: We call the constant as a function to support Perl 5.6.
19+
my %info = (Creator::cplusplus() => {'ext' => '.vcxproj',
20+
'dllexe' => 'vs2022exe',
21+
'libexe' => 'vs2022libexe',
22+
'dll' => 'vs2022dll',
23+
'lib' => 'vs2022lib',
24+
'template' => [ 'vc10', 'vc10filters' ],
25+
},
26+
);
27+
28+
my %config = ('vcversion' => '16.00',
29+
'toolsversion' => '16.0',
30+
);
31+
32+
# ************************************************************
33+
# Subroutine Section
34+
# ************************************************************
35+
36+
sub get_info_hash {
37+
my($self, $key) = @_;
38+
39+
## If we have the setting in our information map, then use it.
40+
return $info{$key} if (defined $info{$key});
41+
42+
## Otherwise, see if our parent type can take care of it.
43+
return $self->SUPER::get_info_hash($key);
44+
}
45+
46+
sub get_configurable {
47+
my($self, $name) = @_;
48+
49+
## If we have the setting in our config map, then use it.
50+
return $config{$name} if (defined $config{$name});
51+
52+
## Otherwise, see if our parent type can take care of it.
53+
return $self->SUPER::get_configurable($name);
54+
}
55+
56+
1;

modules/VS2022WorkspaceCreator.pm

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package VS2022WorkspaceCreator;
2+
3+
# ************************************************************
4+
# Description : vs2022 (Visual Studio 2022) Workspace Creator
5+
# ************************************************************
6+
7+
# ************************************************************
8+
# Pragmas
9+
# ************************************************************
10+
11+
use strict;
12+
13+
use VS2022ProjectCreator;
14+
use VC12WorkspaceCreator;
15+
16+
use vars qw(@ISA);
17+
@ISA = qw(VC12WorkspaceCreator);
18+
19+
# ************************************************************
20+
# Subroutine Section
21+
# ************************************************************
22+
23+
sub pre_workspace {
24+
my($self, $fh) = @_;
25+
my $crlf = $self->crlf();
26+
27+
print $fh '', $crlf,
28+
'Microsoft Visual Studio Solution File, Format Version 12.00', $crlf;
29+
$self->print_workspace_comment($fh,
30+
'# Visual Studio 17', $crlf,
31+
'#', $crlf,
32+
'# This file was generated by MPC. Any changes made directly to', $crlf,
33+
'# this file will be lost the next time it is generated.', $crlf,
34+
'#', $crlf,
35+
'# MPC Command:', $crlf,
36+
'# ', $self->create_command_line_string($0, @ARGV), $crlf);
37+
}
38+
39+
1;

registry.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
'vc14' => ['SLN 14.0', 'VCPROJ 14.0'],
3939
'vs2017' => ['SLN 2017', 'PROJ 2017'],
4040
'vs2019' => ['SLN 2019', 'PROJ 2019'],
41+
'vs2022' => ['SLN 2022', 'PROJ 2022'],
4142
'wix' => ['WiX', 'WiX Project'],
4243
);
4344

templates/vs2022dll.mpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// -*- MPC -*-
2+
conditional_include "vs2022platforms"
3+
conditional_include "vc1xdll"
4+
conditional_include "user_vs2022dll"

0 commit comments

Comments
 (0)