From ce0d020cfd22f6f47b8b5cf265222e958ab313f0 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 31 Dec 2021 13:10:20 +0100 Subject: [PATCH] makepanda: Add handling for Windows 11 SDK --- README.md | 2 +- makepanda/makepanda.py | 2 +- makepanda/makepandacore.py | 12 +++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 63b493dfc2..1b3cd3d1bf 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 018b57029b..86011cb217 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -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("") diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 21ec31f5f9..1ecf349fb1 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -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))