summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Mitz <mitza@objectcomputing.com>2021-11-10 14:29:41 -0600
committerGitHub <noreply@github.com>2021-11-10 14:29:41 -0600
commit2fb865ff5c429bcecbfb168b48952caaeb038700 (patch)
treecff089da04552f7067e54994704167efb19b1322
parent1abb954e30a844c28ac45af64fbaadd7915a2610 (diff)
parent7ac5f65d66146090573d322a58f7cdddc63556ca (diff)
downloadMPC-2fb865ff5c429bcecbfb168b48952caaeb038700.tar.gz
Merge pull request #146 from mitza-oci/vs2022
Generate Visual Studio 2022 projects and solutions
-rw-r--r--config/pin_base.mpb2
-rw-r--r--config/pintool.mpb4
-rw-r--r--config/winapp.mpb5
-rw-r--r--config/wireshark.mpb5
-rw-r--r--docs/USAGE5
-rw-r--r--docs/html/MakeProjectCreator.html24
-rw-r--r--modules/VS2022ProjectCreator.pm56
-rw-r--r--modules/VS2022WorkspaceCreator.pm39
-rwxr-xr-xregistry.pl1
-rw-r--r--templates/vs2022dll.mpt4
-rw-r--r--templates/vs2022exe.mpt4
-rw-r--r--templates/vs2022lib.mpt4
-rw-r--r--templates/vs2022libexe.mpt4
-rw-r--r--templates/vs2022platforms.mpt38
14 files changed, 179 insertions, 16 deletions
diff --git a/config/pin_base.mpb b/config/pin_base.mpb
index 26bb6d5d..261b367e 100644
--- a/config/pin_base.mpb
+++ b/config/pin_base.mpb
@@ -15,7 +15,7 @@ project {
compile_flags += /Oy
}
- specific (vc10, vc11, vc12, vc14, vs2017, vs2019) {
+ specific (prop:microsoft) {
runtime_library = MultiThreaded
ImageHasSafeExceptionHandlers = false
diff --git a/config/pintool.mpb b/config/pintool.mpb
index bf795467..23229bc0 100644
--- a/config/pintool.mpb
+++ b/config/pintool.mpb
@@ -41,7 +41,7 @@ feature (ia32) {
link_options += /ENTRY:Ptrace_DllMainCRTStartup@12
}
- specific (vc10, vc11, vc12, vc14, vs2017, vs2019) {
+ specific (prop:microsoft) {
EntryPointSymbol = Ptrace_DllMainCRTStartup@12
}
}
@@ -51,7 +51,7 @@ feature (intel64) {
link_options += /ENTRY:Ptrace_DllMainCRTStartup
}
- specific (vc10, vc11, vc12, vc14, vs2017, vs2019) {
+ specific (prop:microsoft) {
EntryPointSymbol = Ptrace_DllMainCRTStartup
}
diff --git a/config/winapp.mpb b/config/winapp.mpb
index b87b3d42..cacbfb2f 100644
--- a/config/winapp.mpb
+++ b/config/winapp.mpb
@@ -1,11 +1,8 @@
// -*- MPC -*-
project {
- specific(em3, nmake, vc6) {
+ specific(nmake) {
subsystem = windows
} else {
- subsystem = 2
- }
- specific(vc10, vc11, vc12, vc14, vs2017, vs2019) {
subsystem = Windows
}
}
diff --git a/config/wireshark.mpb b/config/wireshark.mpb
index 0a8c24ef..85d2d2b3 100644
--- a/config/wireshark.mpb
+++ b/config/wireshark.mpb
@@ -32,13 +32,16 @@ project : glib {
specific(vs2019) {
macros += MSC_VER_REQUIRED=1920
}
+ specific(vs2022) {
+ macros += MSC_VER_REQUIRED=1930
+ }
verbatim(nmake, top, 1) {
include $(WIRESHARK_SRC)/config.nmake
}
}
// Autoconf / In Source Wireshark Build Method
-// This feasture works with how Wireshark Developers Guide says to build
+// This feature works with how Wireshark Developers Guide says to build
// Wireshark on Linux (autogen.sh). This is also used for older 1.x Wireshark
// Windows builds and if Wireshark headers are installed on the system.
// On Windows $(WIRETAP_VERSION) also has to be specified as well.
diff --git a/docs/USAGE b/docs/USAGE
index c0c8dfa7..49b3c5d1 100644
--- a/docs/USAGE
+++ b/docs/USAGE
@@ -25,8 +25,9 @@ Usage: mwc.pl [-global <file>] [-include <directory>] [-recurse]
[-language <cplusplus | csharp | java | vb>]
[-type <automake | bcb2007 | bcb2009 | bds4 | bmake | cc | cdt6 |
cdt7 | em3 | ghs | html | iar | make | nmake | rpmspec |
- sle | uvis | vc6 | vc7 | vc8 | vc9 | vc10 | vc11 | vc12 |
- vc14 | vs2017 | vs2019 | vc71 | wb26 | wb30 | wix>]
+ sle | uvis | vc6 | vc7 | vc71 | vc8 | vc9 | vc10 | vc11 |
+ vc12 | vc14 | vs2017 | vs2019 | vs2022 | wb26 | wb30 |
+ wix>]
[files]
-base Add <project> as a base project to each generated
diff --git a/docs/html/MakeProjectCreator.html b/docs/html/MakeProjectCreator.html
index d2d8dc92..6e59a72b 100644
--- a/docs/html/MakeProjectCreator.html
+++ b/docs/html/MakeProjectCreator.html
@@ -530,6 +530,18 @@
<tr>
<td rowspan="1" colspan="1">
<p class="TblCode">
+ <em class="TableCode">vs2022</em>
+ </p>
+ </td>
+
+ <td rowspan="1" colspan="1">
+ <p class="Tbl-Body">Visual Studio 2022.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td rowspan="1" colspan="1">
+ <p class="TblCode">
<em class="TableCode">
<a href="WB26.html">
wb26
@@ -1838,7 +1850,7 @@ class="XRef">the -workers_port option</a>,
"Code">vc7</em>, <em class="Code">vc71</em>, <em class="Code">vc8</em>,
<em class="Code">vc9</em>, <em class="Code">vc10</em>, <em class="Code">vc11</em>,
<em class="Code">vc12</em>, <em class="Code">vc14</em>,
- <em class="Code">vs2017</em>, and <em class="Code">vs2019</em> project types. If this environment
+ and <em class="Code">vs*</em> project types. If this environment
variable is set, MPC will generate inter-project dependencies for
libraries within a single workspace. This is usually not desired
since adding these dependencies in a static workspace has the side
@@ -1994,7 +2006,7 @@ class="XRef">the -workers_port option</a>,
<p class="Code">
&nbsp;&nbsp;exclude(vc6, vc7, vc71, vc8, vc9,
- vc10, vc11, vc12, vc14, vs2017, vs2019, nmake) {
+ vc10, vc11, vc12, vc14, vs2017, vs2019, vs2022, nmake) {
</p>
<p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;this_directory</p>
@@ -2603,7 +2615,7 @@ class="Code">specific</em> clause.
<em class="Code">vc10</em>, <em class="Code">vc11</em>,
<em class="Code">vc12</em>, <em class="Code">vc14</em>,
<em class="Code">vc12</em>, <em class="Code">vc14</em>,
- <em class="Code">vs2017</em>, and <em class="Code">vs2019</em> project types.
+ and <em class="Code">vs*</em> project types.
</p>
</td>
</tr>
@@ -3250,7 +3262,7 @@ class="Code">specific</em> clause.
"Code">vc7</em>, <em class="Code">vc71</em>, <em class="Code">vc8</em>,
<em class="Code">vc9</em>, <em class="Code">vc10</em>, <em class="Code">vc11</em>,
<em class="Code">vc12</em>, <em class="Code">vc14</em>,
- <em class="Code">vs2017</em>, and <em class="Code">vs2019</em> project types.
+ and <em class="Code">vs*</em> project types.
</p>
<p class="Body">
@@ -8110,7 +8122,7 @@ class="Code">specific</em> clause.
7.10 is return for vc71 and 8.00 is returned for vc8,
9.00 is returned for vc9, 10.00 is returned for vc10,
11.00 is returned for vc11, 12.0 is returned for vc12,
- 14.0 is returned for vc14, 14.1 is returned for vs2017, 14.2 is returned for vs2019.
+ 14.0 is returned for vc14, 14.1 is returned for vs2017, 14.2 is returned for vs2019, 14.3 is returned for vs2022.
</p>
</td>
</tr>
@@ -8428,7 +8440,7 @@ class="Code">specific</em> clause.
<p class="Body">
Certain project types don't support the same
input file used by multiple custom types (current examples of
- this are vc10, vc11, vc12, vc14, vs2017, vs2019, cdt6, and cdt7). To accommodate these types, MPC
+ this are vc10, vc11, vc12, vc14, vs*, cdt6, and cdt7). To accommodate these types, MPC
has a capability called "combined custom". With this capability
enabled in the specific ProjectCreator, MPC will "fold together"
the multiple custom steps so that the target tool (Visual Studio
diff --git a/modules/VS2022ProjectCreator.pm b/modules/VS2022ProjectCreator.pm
new file mode 100644
index 00000000..2f9ce191
--- /dev/null
+++ b/modules/VS2022ProjectCreator.pm
@@ -0,0 +1,56 @@
+package VS2022ProjectCreator;
+
+# ************************************************************
+# Description : vs2022 (Visual Studio 2022) Project Creator
+# ************************************************************
+
+# ************************************************************
+# Pragmas
+# ************************************************************
+
+use strict;
+
+use VC12ProjectCreator;
+
+use vars qw(@ISA);
+@ISA = qw(VC12ProjectCreator);
+
+## NOTE: We call the constant as a function to support Perl 5.6.
+my %info = (Creator::cplusplus() => {'ext' => '.vcxproj',
+ 'dllexe' => 'vs2022exe',
+ 'libexe' => 'vs2022libexe',
+ 'dll' => 'vs2022dll',
+ 'lib' => 'vs2022lib',
+ 'template' => [ 'vc10', 'vc10filters' ],
+ },
+ );
+
+my %config = ('vcversion' => '16.00',
+ 'toolsversion' => '16.0',
+ );
+
+# ************************************************************
+# Subroutine Section
+# ************************************************************
+
+sub get_info_hash {
+ my($self, $key) = @_;
+
+ ## If we have the setting in our information map, then use it.
+ return $info{$key} if (defined $info{$key});
+
+ ## Otherwise, see if our parent type can take care of it.
+ return $self->SUPER::get_info_hash($key);
+}
+
+sub get_configurable {
+ my($self, $name) = @_;
+
+ ## If we have the setting in our config map, then use it.
+ return $config{$name} if (defined $config{$name});
+
+ ## Otherwise, see if our parent type can take care of it.
+ return $self->SUPER::get_configurable($name);
+}
+
+1;
diff --git a/modules/VS2022WorkspaceCreator.pm b/modules/VS2022WorkspaceCreator.pm
new file mode 100644
index 00000000..39393912
--- /dev/null
+++ b/modules/VS2022WorkspaceCreator.pm
@@ -0,0 +1,39 @@
+package VS2022WorkspaceCreator;
+
+# ************************************************************
+# Description : vs2022 (Visual Studio 2022) Workspace Creator
+# ************************************************************
+
+# ************************************************************
+# Pragmas
+# ************************************************************
+
+use strict;
+
+use VS2022ProjectCreator;
+use VC12WorkspaceCreator;
+
+use vars qw(@ISA);
+@ISA = qw(VC12WorkspaceCreator);
+
+# ************************************************************
+# Subroutine Section
+# ************************************************************
+
+sub pre_workspace {
+ my($self, $fh) = @_;
+ my $crlf = $self->crlf();
+
+ print $fh '', $crlf,
+ 'Microsoft Visual Studio Solution File, Format Version 12.00', $crlf;
+ $self->print_workspace_comment($fh,
+ '# Visual Studio 17', $crlf,
+ '#', $crlf,
+ '# This file was generated by MPC. Any changes made directly to', $crlf,
+ '# this file will be lost the next time it is generated.', $crlf,
+ '#', $crlf,
+ '# MPC Command:', $crlf,
+ '# ', $self->create_command_line_string($0, @ARGV), $crlf);
+}
+
+1;
diff --git a/registry.pl b/registry.pl
index d8a61552..800c4445 100755
--- a/registry.pl
+++ b/registry.pl
@@ -38,6 +38,7 @@ my %types = ('nmake' => ['NMAKE', 'NMAKE'],
'vc14' => ['SLN 14.0', 'VCPROJ 14.0'],
'vs2017' => ['SLN 2017', 'PROJ 2017'],
'vs2019' => ['SLN 2019', 'PROJ 2019'],
+ 'vs2022' => ['SLN 2022', 'PROJ 2022'],
'wix' => ['WiX', 'WiX Project'],
);
diff --git a/templates/vs2022dll.mpt b/templates/vs2022dll.mpt
new file mode 100644
index 00000000..bc918721
--- /dev/null
+++ b/templates/vs2022dll.mpt
@@ -0,0 +1,4 @@
+// -*- MPC -*-
+conditional_include "vs2022platforms"
+conditional_include "vc1xdll"
+conditional_include "user_vs2022dll"
diff --git a/templates/vs2022exe.mpt b/templates/vs2022exe.mpt
new file mode 100644
index 00000000..cc2bbc24
--- /dev/null
+++ b/templates/vs2022exe.mpt
@@ -0,0 +1,4 @@
+// -*- MPC -*-
+conditional_include "vs2022platforms"
+conditional_include "vc1xexe"
+conditional_include "user_vs2022exe"
diff --git a/templates/vs2022lib.mpt b/templates/vs2022lib.mpt
new file mode 100644
index 00000000..29fcdcd9
--- /dev/null
+++ b/templates/vs2022lib.mpt
@@ -0,0 +1,4 @@
+// -*- MPC -*-
+conditional_include "vs2022platforms"
+conditional_include "vc1xlib"
+conditional_include "user_vs2022lib"
diff --git a/templates/vs2022libexe.mpt b/templates/vs2022libexe.mpt
new file mode 100644
index 00000000..8f347b3e
--- /dev/null
+++ b/templates/vs2022libexe.mpt
@@ -0,0 +1,4 @@
+// -*- MPC -*-
+conditional_include "vs2022platforms"
+conditional_include "vc1xlibexe"
+conditional_include "user_vs2022libexe"
diff --git a/templates/vs2022platforms.mpt b/templates/vs2022platforms.mpt
new file mode 100644
index 00000000..6e08c088
--- /dev/null
+++ b/templates/vs2022platforms.mpt
@@ -0,0 +1,38 @@
+// -*- MPC -*-
+//
+// Any of these platforms can set using value_template platforms=
+// when generating solutions/projects.
+//
+
+platforms = Win32 x64 ARM ARM64
+default_platform = x64
+PlatformToolset = v143
+WindowsTargetPlatformVersion = 10.0
+
+Win32 {
+ output_subdir = I386
+}
+
+x64 {
+ output_subdir = AMD64
+ cpu_defines = _AMD64_
+ platform_defines = _WIN64
+ TargetMachine = "0" // We let VC++ figure it out for us.
+ link_options = /machine:AMD64
+}
+
+ARM {
+ output_subdir = ARM
+ cpu_defines = _ARM_
+ platform_defines = _ARM
+ TargetMachine = "0" // We let VC++ figure it out for us.
+ link_options = /machine:ARM
+}
+
+ARM64 {
+ output_subdir = ARM64
+ cpu_defines = _ARM64_
+ platform_defines = _ARM64
+ TargetMachine = "0" // We let VC++ figure it out for us.
+ link_options = /machine:ARM64
+}