From c1f8752426e9c2e5398d197b5740325ab37967bb Mon Sep 17 00:00:00 2001 From: Sihu Hwang <129564966+hwangsihu@users.noreply.github.com> Date: Fri, 27 Feb 2026 21:27:25 +0900 Subject: [PATCH] Add support for Visual Studio 2026 --- .github/workflows/cmake.yml | 3 ++ .github/workflows/windows.yml | 16 +++++++++ config/wireshark.mpb | 3 ++ docs/USAGE | 2 +- docs/html/MakeProjectCreator.html | 40 ++++++++++++++++++++-- modules/VS2026ProjectCreator.pm | 56 +++++++++++++++++++++++++++++++ modules/VS2026WorkspaceCreator.pm | 39 +++++++++++++++++++++ registry.pl | 1 + templates/vs2026dll.mpt | 4 +++ templates/vs2026exe.mpt | 4 +++ templates/vs2026lib.mpt | 4 +++ templates/vs2026libexe.mpt | 4 +++ templates/vs2026platforms.mpt | 38 +++++++++++++++++++++ 13 files changed, 211 insertions(+), 3 deletions(-) create mode 100644 modules/VS2026ProjectCreator.pm create mode 100644 modules/VS2026WorkspaceCreator.pm create mode 100644 templates/vs2026dll.mpt create mode 100644 templates/vs2026exe.mpt create mode 100644 templates/vs2026lib.mpt create mode 100644 templates/vs2026libexe.mpt create mode 100644 templates/vs2026platforms.mpt diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 48078b84..9af673b3 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -27,6 +27,9 @@ jobs: - CC: vs2022 CXX: vs2022 os: windows-2022 + - CC: vs2026 + CXX: vs2026 + os: windows-2025-vs2026 runs-on: ${{ matrix.os }} name: ${{ matrix.os }} ${{ matrix.CXX }} env: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b5c32953..d872a2aa 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -36,6 +36,22 @@ jobs: vcpkgarch: x86-windows vcpkglibdir: lib vcpkgpackages: '"openssl", "xerces-c", "zlib"' + - name: VS2026Debug64 + vmimage: windows-2025-vs2026 + mpctype: vs2026 + BuildPlatform: x64 + BuildConfiguration: Debug + vcpkgarch: x64-windows + vcpkglibdir: debug/lib + vcpkgpackages: '"openssl", "xerces-c", "zlib"' + - name: VS2026Release32 + vmimage: windows-2025-vs2026 + mpctype: vs2026 + BuildPlatform: Win32 + BuildConfiguration: Release + vcpkgarch: x86-windows + vcpkglibdir: lib + vcpkgpackages: '"openssl", "xerces-c", "zlib"' runs-on: ${{ matrix.vmimage }} name: ${{ matrix.name }} env: diff --git a/config/wireshark.mpb b/config/wireshark.mpb index 424e587b..c6154a86 100644 --- a/config/wireshark.mpb +++ b/config/wireshark.mpb @@ -35,6 +35,9 @@ project : glib { specific(vs2022) { macros += MSC_VER_REQUIRED=1930 } + specific(vs2026) { + macros += MSC_VER_REQUIRED=1950 + } verbatim(nmake, top, 1) { include $(WIRESHARK_SRC)/config.nmake } diff --git a/docs/USAGE b/docs/USAGE index 47eac0ba..3f847d76 100644 --- a/docs/USAGE +++ b/docs/USAGE @@ -26,7 +26,7 @@ Usage: mwc.pl [-global ] [-include ] [-recurse] [-type ] [files] diff --git a/docs/html/MakeProjectCreator.html b/docs/html/MakeProjectCreator.html index 74d223a6..c1872b6d 100644 --- a/docs/html/MakeProjectCreator.html +++ b/docs/html/MakeProjectCreator.html @@ -551,6 +551,18 @@
MPC Types
+ + +

+ vs2026 +

+ + + +

Visual Studio 2026.

+ + +

@@ -2018,7 +2030,7 @@

mwc and mwb files

  exclude(vc6, vc7, vc71, vc8, vc9, - vc10, vc11, vc12, vc14, vs2017, vs2019, vs2022, nmake) { + vc10, vc11, vc12, vc14, vs2017, vs2019, vs2022, vs2026, nmake) {

    this_directory

@@ -4019,6 +4031,30 @@
+ + +

+ vs2026 +

+ + + +

 

+ + + +

 

+ + + +

Yes

+ + + +

Yes

+ + +

@@ -8271,7 +8307,7 @@

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.3 is returned for vs2022. + 14.0 is returned for vc14, 14.1 is returned for vs2017, 14.2 is returned for vs2019, 14.3 is returned for vs2022, 14.5 is returned for vs2026.

diff --git a/modules/VS2026ProjectCreator.pm b/modules/VS2026ProjectCreator.pm new file mode 100644 index 00000000..aa344838 --- /dev/null +++ b/modules/VS2026ProjectCreator.pm @@ -0,0 +1,56 @@ +package VS2026ProjectCreator; + +# ************************************************************ +# Description : vs2026 (Visual Studio 2026) 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' => 'vs2026exe', + 'libexe' => 'vs2026libexe', + 'dll' => 'vs2026dll', + 'lib' => 'vs2026lib', + 'template' => [ 'vc10', 'vc10filters' ], + }, + ); + +my %config = ('vcversion' => '18.00', + 'toolsversion' => '18.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/VS2026WorkspaceCreator.pm b/modules/VS2026WorkspaceCreator.pm new file mode 100644 index 00000000..6ebd23d9 --- /dev/null +++ b/modules/VS2026WorkspaceCreator.pm @@ -0,0 +1,39 @@ +package VS2026WorkspaceCreator; + +# ************************************************************ +# Description : vs2026 (Visual Studio 2026) Workspace Creator +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use VS2026ProjectCreator; +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 Version 18', $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 800c4445..4bcc7250 100755 --- a/registry.pl +++ b/registry.pl @@ -39,6 +39,7 @@ 'vs2017' => ['SLN 2017', 'PROJ 2017'], 'vs2019' => ['SLN 2019', 'PROJ 2019'], 'vs2022' => ['SLN 2022', 'PROJ 2022'], + 'vs2026' => ['SLN 2026', 'PROJ 2026'], 'wix' => ['WiX', 'WiX Project'], ); diff --git a/templates/vs2026dll.mpt b/templates/vs2026dll.mpt new file mode 100644 index 00000000..5bfb4819 --- /dev/null +++ b/templates/vs2026dll.mpt @@ -0,0 +1,4 @@ +// -*- MPC -*- +conditional_include "vs2026platforms" +conditional_include "vc1xdll" +conditional_include "user_vs2026dll" diff --git a/templates/vs2026exe.mpt b/templates/vs2026exe.mpt new file mode 100644 index 00000000..151dee80 --- /dev/null +++ b/templates/vs2026exe.mpt @@ -0,0 +1,4 @@ +// -*- MPC -*- +conditional_include "vs2026platforms" +conditional_include "vc1xexe" +conditional_include "user_vs2026exe" diff --git a/templates/vs2026lib.mpt b/templates/vs2026lib.mpt new file mode 100644 index 00000000..3000e7dc --- /dev/null +++ b/templates/vs2026lib.mpt @@ -0,0 +1,4 @@ +// -*- MPC -*- +conditional_include "vs2026platforms" +conditional_include "vc1xlib" +conditional_include "user_vs2026lib" diff --git a/templates/vs2026libexe.mpt b/templates/vs2026libexe.mpt new file mode 100644 index 00000000..d9536a50 --- /dev/null +++ b/templates/vs2026libexe.mpt @@ -0,0 +1,4 @@ +// -*- MPC -*- +conditional_include "vs2026platforms" +conditional_include "vc1xlibexe" +conditional_include "user_vs2026libexe" diff --git a/templates/vs2026platforms.mpt b/templates/vs2026platforms.mpt new file mode 100644 index 00000000..ab3c66c4 --- /dev/null +++ b/templates/vs2026platforms.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 = v145 +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 +}