Skip to content

Commit 3b4bdfa

Browse files
authored
Merge pull request #4780 from Repiteo/VS2026
Add Visual Studio 2026 support
2 parents 2927f78 + 21cd6e6 commit 3b4bdfa

File tree

12 files changed

+223
-53
lines changed

12 files changed

+223
-53
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
1515
From John Doe:
1616
- Whatever John Doe did.
1717

18+
From Thaddeus Crews:
19+
- Add support for Visual Studio 2026.
20+
1821
From William Deegan:
1922
- Fix copyright date in API docs to match that in the rest of the build.
2023

RELEASE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ NEW FUNCTIONALITY
1818

1919
- List new features (presumably why a checkpoint is being released)
2020

21+
- Add support for Visual Studio 2026.
22+
2123
DEPRECATED FUNCTIONALITY
2224
------------------------
2325

SCons/Tool/MSCommon/MSVC/Config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
CL_VERSION_MAP = {}
139139

140140
for (vc_buildseries, vc_version, cl_version) in [
141+
('145', '14.5', '19.5'),
141142
('144', '14.4', '19.4'),
142143
('143', '14.3', '19.3'),
143144
('142', '14.2', '19.2'),
@@ -190,6 +191,7 @@
190191
MSVC_VERSION_NEWEST_NUMERIC = 0.0
191192

192193
for vc_buildtools, vc_buildseries_list, vc_runtime, vc_istoolset in [
194+
('v145', ['145'], '140', True),
193195
('v143', ['144', '143'], '140', True),
194196
('v142', ['142'], '140', True),
195197
('v141', ['141'], '140', True),
@@ -275,6 +277,7 @@
275277
# MSVS 2010 and earlier cl_version -> vs_def is a 1:1 mapping
276278
# SDK attached to product or buildtools?
277279
for vs_product, vs_version, vs_envvar, vs_express, vs_lookup, vc_sdk, vc_ucrt, vc_uwp, vc_buildtools_all in [
280+
('2026', '18.0', True, False, 'vswhere' , ['10.0', '8.1'], ['10'], 'uwp', ['v145', 'v143', 'v142', 'v141', 'v140']),
278281
('2022', '17.0', True, False, 'vswhere' , ['10.0', '8.1'], ['10'], 'uwp', ['v143', 'v142', 'v141', 'v140']),
279282
('2019', '16.0', True, False, 'vswhere' , ['10.0', '8.1'], ['10'], 'uwp', ['v142', 'v141', 'v140']),
280283
('2017', '15.0', True, True, 'vswhere' , ['10.0', '8.1'], ['10'], 'uwp', ['v141', 'v140']),

SCons/Tool/MSCommon/MSVC/ScriptArguments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def msvc_force_default_arguments(force=None):
144144

145145
# MSVC batch file arguments:
146146
#
147+
# VS2026: UWP, SDK, TOOLSET, SPECTRE
147148
# VS2022: UWP, SDK, TOOLSET, SPECTRE
148149
# VS2019: UWP, SDK, TOOLSET, SPECTRE
149150
# VS2017: UWP, SDK, TOOLSET, SPECTRE

SCons/Tool/MSCommon/README.rst

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ installation is used only when no other installation is detected.
3636
+---------+---------+----------------------------------------------------------+
3737
| Product | VCVer | Priority |
3838
+=========+=========+==========================================================+
39+
| VS2026 | 14.5 | Enterprise, Professional, Community, BuildTools |
40+
+=========+=========+==========================================================+
3941
| VS2022 | 14.3 | Enterprise, Professional, Community, BuildTools |
4042
+---------+---------+----------------------------------------------------------+
4143
| VS2019 | 14.2 | Enterprise, Professional, Community, BuildTools |
@@ -224,6 +226,7 @@ Example usage:
224226
::
225227

226228
for version in [
229+
'14.5',
227230
'14.4',
228231
'14.3',
229232
'14.2',
@@ -360,6 +363,8 @@ Supported MSVC batch file arguments by product:
360363
+---------+---------+--------+---------+---------+
361364
| Product | UWP | SDK | Toolset | Spectre |
362365
+=========+=========+========+=========+=========+
366+
| VS2026 | X | X | X | X |
367+
+=========+=========+========+=========+=========+
363368
| VS2022 | X | X | X | X |
364369
+---------+---------+--------+---------+---------+
365370
| VS2019 | X | X | X | X |
@@ -514,6 +519,8 @@ BuildSeries Versions
514519
+-------------+-------+-------+
515520
| BuildSeries | VCVER | CLVER |
516521
+=============+=======+=======+
522+
| 14.5 | 14.5X | 19.5 |
523+
+-------------+-------+-------+
517524
| 14.4 | 14.4X | 19.4 |
518525
+-------------+-------+-------+
519526
| 14.3 | 14.3X | 19.3 |
@@ -547,6 +554,8 @@ BuildTools Versions
547554
+------------+-------------+----------+
548555
| BuildTools | BuildSeries | MSVCRT |
549556
+============+=============+==========+
557+
| v145 | 14.5 | 140/ucrt |
558+
+------------+-------------+----------+
550559
| v143 | 14.4, 14.3 | 140/ucrt |
551560
+------------+-------------+----------+
552561
| v142 | 14.2 | 140/ucrt |
@@ -575,33 +584,35 @@ BuildTools Versions
575584
Product Versions
576585
----------------
577586

578-
+----------+-------+-------+-----------+------------------------+
579-
| Product | VSVER | SCons | SDK | BuildTools |
580-
+==========+=======+=======+===========+========================+
581-
| 2022 | 17.0 | 14.3 | 10.0, 8.1 | v143, v142, v141, v140 |
582-
+----------+-------+-------+-----------+------------------------+
583-
| 2019 | 16.0 | 14.2 | 10.0, 8.1 | v142, v141, v140 |
584-
+----------+-------+-------+-----------+------------------------+
585-
| 2017 | 15.0 | 14.1 | 10.0, 8.1 | v141, v140 |
586-
+----------+-------+-------+-----------+------------------------+
587-
| 2015 | 14.0 | 14.0 | 10.0, 8.1 | v140 |
588-
+----------+-------+-------+-----------+------------------------+
589-
| 2013 | 12.0 | 12.0 | | v120 |
590-
+----------+-------+-------+-----------+------------------------+
591-
| 2012 | 11.0 | 11.0 | | v110 |
592-
+----------+-------+-------+-----------+------------------------+
593-
| 2010 | 10.0 | 10.0 | | v100 |
594-
+----------+-------+-------+-----------+------------------------+
595-
| 2008 | 9.0 | 9.0 | | v90 |
596-
+----------+-------+-------+-----------+------------------------+
597-
| 2005 | 8.0 | 8.0 | | v80 |
598-
+----------+-------+-------+-----------+------------------------+
599-
| 2003.NET | 7.1 | 7.1 | | v71 |
600-
+----------+-------+-------+-----------+------------------------+
601-
| 2002.NET | 7.0 | 7.0 | | v70 |
602-
+----------+-------+-------+-----------+------------------------+
603-
| 6.0 | 6.0 | 6.0 | | v60 |
604-
+----------+-------+-------+-----------+------------------------+
587+
+----------+-------+-------+-----------+------------------------------+
588+
| Product | VSVER | SCons | SDK | BuildTools |
589+
+==========+=======+=======+===========+==============================+
590+
| 2026 | 18.0 | 14.5 | 10.0, 8.1 | v145, v143, v142, v141, v140 |
591+
+----------+-------+-------+-----------+------------------------------+
592+
| 2022 | 17.0 | 14.3 | 10.0, 8.1 | v143, v142, v141, v140 |
593+
+----------+-------+-------+-----------+------------------------------+
594+
| 2019 | 16.0 | 14.2 | 10.0, 8.1 | v142, v141, v140 |
595+
+----------+-------+-------+-----------+------------------------------+
596+
| 2017 | 15.0 | 14.1 | 10.0, 8.1 | v141, v140 |
597+
+----------+-------+-------+-----------+------------------------------+
598+
| 2015 | 14.0 | 14.0 | 10.0, 8.1 | v140 |
599+
+----------+-------+-------+-----------+------------------------------+
600+
| 2013 | 12.0 | 12.0 | | v120 |
601+
+----------+-------+-------+-----------+------------------------------+
602+
| 2012 | 11.0 | 11.0 | | v110 |
603+
+----------+-------+-------+-----------+------------------------------+
604+
| 2010 | 10.0 | 10.0 | | v100 |
605+
+----------+-------+-------+-----------+------------------------------+
606+
| 2008 | 9.0 | 9.0 | | v90 |
607+
+----------+-------+-------+-----------+------------------------------+
608+
| 2005 | 8.0 | 8.0 | | v80 |
609+
+----------+-------+-------+-----------+------------------------------+
610+
| 2003.NET | 7.1 | 7.1 | | v71 |
611+
+----------+-------+-------+-----------+------------------------------+
612+
| 2002.NET | 7.0 | 7.0 | | v70 |
613+
+----------+-------+-------+-----------+------------------------------+
614+
| 6.0 | 6.0 | 6.0 | | v60 |
615+
+----------+-------+-------+-----------+------------------------------+
605616

606617

607618
SCons Implementation Notes
@@ -713,7 +724,7 @@ into the current document format as appropriate.
713724

714725

715726
Problems:
716-
- For VS >= 2017, VS and VS are not 1:1, there can be many VC for one VS
727+
- For VS >= 2017, VC and VS are not 1:1, there can be many VC for one VS
717728
- For vswhere-ready versions, detection does not proceed beyond the
718729
product level ("2019") into individual "features" (individual msvc)
719730
- As documented for MSVC_VERSION, compilers can only be requested if versions

SCons/Tool/MSCommon/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
VS_VC_VARS = [
5555
'COMSPEC', # path to "shell"
5656
'OS', # name of OS family: Windows_NT or undefined (95/98/ME)
57-
'VS170COMNTOOLS', # path to common tools for given version
57+
'VS180COMNTOOLS', # path to common tools for given version
58+
'VS170COMNTOOLS',
5859
'VS160COMNTOOLS',
5960
'VS150COMNTOOLS',
6061
'VS140COMNTOOLS',

SCons/Tool/MSCommon/vc.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ def _skip_sendtelemetry(env):
736736
# If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the
737737
# MSVC_VERSION documentation in Tool/msvc.xml.
738738
_VCVER = [
739+
"14.5",
739740
"14.3",
740741
"14.2",
741742
"14.1", "14.1Exp",
@@ -759,6 +760,7 @@ def _skip_sendtelemetry(env):
759760
_VSWHERE_SUPPORTED_VCVER = set()
760761

761762
for vs_major, vc_version, vc_ver_list in (
763+
('18', '14.5', None),
762764
('17', '14.3', None),
763765
('16', '14.2', None),
764766
('15', '14.1', ['14.1Exp']),
@@ -855,7 +857,7 @@ def _skip_sendtelemetry(env):
855857

856858
# detect ide binaries
857859

858-
VS2022_VS2002_DEV = (
860+
VS2026_VS2002_DEV = (
859861
MSVC.Kind.IDE_PROGRAM_DEVENV_COM, # devenv.com
860862
)
861863

@@ -885,27 +887,28 @@ def _skip_sendtelemetry(env):
885887

886888
# 'VCVer': (relpath from pdir to vsroot, path from vsroot to ide binaries, ide binaries)
887889

888-
'14.3': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV), # 2022
889-
'14.2': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV), # 2019
890-
'14.1': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2017_EXP), # 2017
891-
'14.1Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2017_EXP), # 2017
892-
893-
'14.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2015_VS2012_EXP), # 2015
894-
'14.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2015_VS2012_EXP), # 2015
895-
'12.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2015_VS2012_EXP), # 2013
896-
'12.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2015_VS2012_EXP), # 2013
897-
'11.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2015_VS2012_EXP), # 2012
898-
'11.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2015_VS2012_EXP), # 2012
899-
900-
'10.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2010_VS2005_EXP), # 2010
901-
'10.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2010_VS2005_EXP), # 2010
902-
'9.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2010_VS2005_EXP), # 2008
903-
'9.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2010_VS2005_EXP), # 2008
904-
'8.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2010_VS2005_EXP), # 2005
905-
'8.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV + VS2010_VS2005_EXP), # 2005
906-
907-
'7.1': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV), # 2003
908-
'7.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2022_VS2002_DEV), # 2001
890+
'14.5': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV), # 2026
891+
'14.3': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV), # 2022
892+
'14.2': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV), # 2019
893+
'14.1': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2017_EXP), # 2017
894+
'14.1Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2017_EXP), # 2017
895+
896+
'14.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2015_VS2012_EXP), # 2015
897+
'14.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2015_VS2012_EXP), # 2015
898+
'12.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2015_VS2012_EXP), # 2013
899+
'12.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2015_VS2012_EXP), # 2013
900+
'11.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2015_VS2012_EXP), # 2012
901+
'11.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2015_VS2012_EXP), # 2012
902+
903+
'10.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2010_VS2005_EXP), # 2010
904+
'10.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2010_VS2005_EXP), # 2010
905+
'9.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2010_VS2005_EXP), # 2008
906+
'9.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2010_VS2005_EXP), # 2008
907+
'8.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2010_VS2005_EXP), # 2005
908+
'8.0Exp': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV + VS2010_VS2005_EXP), # 2005
909+
910+
'7.1': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV), # 2003
911+
'7.0': _DETECT(root='..', path=r'Common7\IDE', programs=VS2026_VS2002_DEV), # 2001
909912

910913
'6.0': _DETECT(root='..', path=r'Common\MSDev98\Bin', programs=VS1998_DEV), # 1998
911914
}

SCons/Tool/MSCommon/vs.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,18 @@ def reset(self) -> None:
213213
# Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml.
214214

215215
SupportedVSList = [
216+
# Visual Studio 2026
217+
VisualStudio('14.5',
218+
vc_version='14.5',
219+
sdk_version='10.0A',
220+
hkeys=[],
221+
common_tools_var='VS180COMNTOOLS',
222+
executable_path=r'Common7\IDE\devenv.com',
223+
# should be a fallback, prefer use vswhere installationPath
224+
batch_file_path=r'Common7\Tools\VsDevCmd.bat',
225+
supported_arch=['x86', 'amd64', "arm", 'arm64'],
226+
),
227+
216228
# Visual Studio 2022
217229
VisualStudio('14.3',
218230
vc_version='14.3',

SCons/Tool/msvc.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,13 @@ Visual Studio </literallayout></entry>
465465
</row>
466466
</thead>
467467
<tbody>
468+
<row>
469+
<entry> <literal>"14.5"</literal> </entry>
470+
<entry> 14.5x </entry>
471+
<entry> 195x </entry>
472+
<entry> Visual Studio 2026 </entry>
473+
<entry> 18.x </entry>
474+
</row>
468475
<row>
469476
<entry> <literal>"14.3"</literal> </entry>
470477
<entry> 14.3x </entry>

SCons/Tool/msvs.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,10 @@ class _GenerateV10User(_UserGenerator):
401401

402402
def __init__(self, dspfile, source, env) -> None:
403403
version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
404-
if version_num >= 14.3:
404+
if version_num >= 14.5:
405+
# Visual Studio 2026 is considered to be version 18.
406+
self.versionstr = '18.0'
407+
elif version_num >= 14.3:
405408
# Visual Studio 2022 is considered to be version 17.
406409
self.versionstr = '17.0'
407410
elif version_num >= 14.2:
@@ -1657,7 +1660,10 @@ def Parse(self):
16571660
def PrintSolution(self) -> None:
16581661
"""Writes a solution file"""
16591662
self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr)
1660-
if self.version_num >= 14.3:
1663+
if self.version_num >= 14.5:
1664+
# Visual Studio 2026 is considered to be version 18.
1665+
self.file.write('# Visual Studio 18\n')
1666+
elif self.version_num >= 14.3:
16611667
# Visual Studio 2022 is considered to be version 17.
16621668
self.file.write('# Visual Studio 17\n')
16631669
elif self.version_num >= 14.2:

0 commit comments

Comments
 (0)