makepanda: default to Windows 8.1 SDK, falling back to 7.1 SDK

We no longer support Windows XP and so there is no point in defaulting to the old 7.1 SDK, which is hard to install.  To target Vista, we can use the 8.1 SDK (+UCRT).
This commit is contained in:
rdb 2020-01-13 15:27:56 +01:00
parent 601fc8f46a
commit 4c1373b721
3 changed files with 19 additions and 18 deletions

View File

@ -55,8 +55,8 @@ Windows
You can build Panda3D with the Microsoft Visual C++ 2015, 2017 or 2019 compiler, You can build Panda3D with the Microsoft Visual C++ 2015, 2017 or 2019 compiler,
which can be downloaded for free from the [Visual Studio site](https://visualstudio.microsoft.com/downloads/). 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 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk),
and if you intend to target Windows XP, you will also need the Windows 7.1A and if you intend to target Windows Vista, you will also need the
SDK (which can be installed from the Visual Studio Installer). [Windows 8.1 SDK](https://go.microsoft.com/fwlink/p/?LinkId=323507).
You will also need to have the third-party dependency libraries available for You will also need to have the third-party dependency libraries available for
the build scripts to use. These are available from one of these two URLs, the build scripts to use. These are available from one of these two URLs,
@ -70,8 +70,8 @@ building them from source.
After acquiring these dependencies, you can build Panda3D from the command After acquiring these dependencies, you can build Panda3D from the command
prompt using the following command. Change the `--msvc-version` option based prompt using the following command. Change the `--msvc-version` option based
on your version of Visual C++; 2019 is 14.2, 2017 is 14.1, and 2015 is 14. on your version of Visual C++; 2019 is 14.2, 2017 is 14.1, and 2015 is 14.
Remove the `--windows-sdk=10` option if you need to support Windows XP, which Remove the `--windows-sdk=10` option if you need to support Windows Vista,
requires the Windows 7.1A SDK. which requires the Windows 8.1 SDK.
```bash ```bash
makepanda\makepanda.bat --everything --installer --msvc-version=14.2 --windows-sdk=10 --no-eigen --threads=2 makepanda\makepanda.bat --everything --installer --msvc-version=14.2 --windows-sdk=10 --no-eigen --threads=2

View File

@ -146,7 +146,7 @@ def usage(problem):
print(" --nothing (disable every third-party lib)") print(" --nothing (disable every third-party lib)")
print(" --everything (enable 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(" --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.1, 8.1 or 10. Default is 8.1)")
print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)") print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)")
print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)") print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
print("") print("")
@ -321,10 +321,6 @@ def parseopts(args):
time.sleep(1.0) time.sleep(1.0)
sys.exit(1) sys.exit(1)
if not WINDOWS_SDK:
print("No Windows SDK version specified. Defaulting to '7.1'.")
WINDOWS_SDK = '7.1'
if clean_build and os.path.isdir(GetOutputDir()): if clean_build and os.path.isdir(GetOutputDir()):
print("Deleting %s" % (GetOutputDir())) print("Deleting %s" % (GetOutputDir()))
shutil.rmtree(GetOutputDir()) shutil.rmtree(GetOutputDir())
@ -1075,10 +1071,6 @@ def CompileCxx(obj,src,opts):
if GetTargetArch() == 'x64': if GetTargetArch() == 'x64':
cmd += " /DWIN64_VC /DWIN64" cmd += " /DWIN64_VC /DWIN64"
if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
# To preserve Windows XP compatibility.
cmd += " /D_USING_V110_SDK71_"
cmd += " /W3 " + BracketNameWithQuotes(src) cmd += " /W3 " + BracketNameWithQuotes(src)
oscmd(cmd) oscmd(cmd)
else: else:

View File

@ -2289,16 +2289,17 @@ def SdkLocateVisualStudio(version=(10,0)):
print("Using MSVC %s" % version_str) print("Using MSVC %s" % version_str)
def SdkLocateWindows(version = '7.1'): def SdkLocateWindows(version=None):
if GetTarget() != "windows" or GetHost() != "windows": if GetTarget() != "windows" or GetHost() != "windows":
return return
version = version.upper() if version:
version = version.upper()
if version == '10': if version == '10':
version = '10.0' version = '10.0'
if version.startswith('10.') and version.count('.') == 1: if version and version.startswith('10.') and version.count('.') == 1:
# Choose the latest version of the Windows 10 SDK. # Choose the latest version of the Windows 10 SDK.
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10")
@ -2333,7 +2334,7 @@ def SdkLocateWindows(version = '7.1'):
# No suitable version found. # No suitable version found.
platsdk = None platsdk = None
elif version.startswith('10.'): elif version and version.startswith('10.'):
# We chose a specific version of the Windows 10 SDK. Verify it exists. # We chose a specific version of the Windows 10 SDK. Verify it exists.
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10")
@ -2347,19 +2348,27 @@ def SdkLocateWindows(version = '7.1'):
if platsdk and not os.path.isdir(os.path.join(platsdk, 'Include', version)): if platsdk and not os.path.isdir(os.path.join(platsdk, 'Include', version)):
platsdk = None platsdk = None
elif version == '8.1': elif version == '8.1' or not version:
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot81") platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot81")
# Fallback in case we can't read the registry. # Fallback in case we can't read the registry.
if not platsdk or not os.path.isdir(platsdk): if not platsdk or not os.path.isdir(platsdk):
platsdk = "C:\\Program Files (x86)\\Windows Kits\\8.1\\" platsdk = "C:\\Program Files (x86)\\Windows Kits\\8.1\\"
if not version:
if not os.path.isdir(platsdk):
# Fall back to 7.1 SDK.
return SdkLocateWindows("7.1")
version = '8.1'
elif version == '8.0': elif version == '8.0':
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot") platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot")
else: else:
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v" + version, "InstallationFolder") platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v" + version, "InstallationFolder")
DefSymbol("ALWAYS", "_USING_V110_SDK71_")
if not platsdk or not os.path.isdir(platsdk): if not platsdk or not os.path.isdir(platsdk):
# Most common location. Worth a try. # Most common location. Worth a try.
platsdk = GetProgramFiles() + "\\Microsoft SDKs\\Windows\\v" + version platsdk = GetProgramFiles() + "\\Microsoft SDKs\\Windows\\v" + version