makepanda: Add handling for Windows 11 SDK

This commit is contained in:
rdb 2021-12-31 13:10:20 +01:00
parent a723567a3a
commit ce0d020cfd
3 changed files with 11 additions and 5 deletions

View File

@ -54,7 +54,7 @@ Windows
You can build Panda3D with the Microsoft Visual C++ 2015, 2017, 2019 or 2022
compiler, which can be downloaded for free from the [Visual Studio site](https://visualstudio.microsoft.com/downloads/).
You will also need to install the [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk),
You will also need to install the [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk),
and if you intend to target Windows XP, you will also need the Windows 7.1A
SDK (which can be installed from the Visual Studio Installer).

View File

@ -159,7 +159,7 @@ def usage(problem):
print(" --nothing (disable every third-party lib)")
print(" --everything (enable every third-party lib)")
print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1, 10 or 11. Default is 7.1)")
print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2, 14.3. Default is 14)")
print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
print("")

View File

@ -2377,7 +2377,7 @@ def SdkLocateWindows(version = '7.1'):
if version == '10':
version = '10.0'
if version.startswith('10.') and version.count('.') == 1:
if (version.startswith('10.') and version.count('.') == 1) or version == '11':
# Choose the latest version of the Windows 10 SDK.
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10")
@ -2386,7 +2386,13 @@ def SdkLocateWindows(version = '7.1'):
platsdk = "C:\\Program Files (x86)\\Windows Kits\\10\\"
if platsdk and os.path.isdir(platsdk):
min_version = (10, 0, 0)
if version == '11':
version = '10.0'
min_version = (10, 0, 22000)
incdirs = glob.glob(os.path.join(platsdk, 'Include', version + '.*.*'))
max_version = ()
for dir in incdirs:
verstring = os.path.basename(dir)
@ -2404,7 +2410,7 @@ def SdkLocateWindows(version = '7.1'):
continue
vertuple = tuple(map(int, verstring.split('.')))
if vertuple > max_version:
if vertuple > max_version and vertuple > min_version:
version = verstring
max_version = vertuple
@ -2900,7 +2906,7 @@ def SetupVisualStudioEnviron():
elif not win_kit.endswith('\\'):
win_kit += '\\'
for vnum in 10150, 10240, 10586, 14393, 15063, 16299, 17134, 17763, 18362, 19041:
for vnum in 10150, 10240, 10586, 14393, 15063, 16299, 17134, 17763, 18362, 19041, 20348, 22000:
version = "10.0.{0}.0".format(vnum)
if os.path.isfile(win_kit + "Include\\" + version + "\\ucrt\\assert.h"):
print("Using Universal CRT %s" % (version))