diff --git a/README.md b/README.md index 7ab91e4372..bf5e918921 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ Windows 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/). 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 -SDK (which can be installed from the Visual Studio Installer). +and if you intend to target Windows Vista, you will also need the +[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 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 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. -Remove the `--windows-sdk=10` option if you need to support Windows XP, which -requires the Windows 7.1A SDK. +Remove the `--windows-sdk=10` option if you need to support Windows Vista, +which requires the Windows 8.1 SDK. ```bash makepanda\makepanda.bat --everything --installer --msvc-version=14.2 --windows-sdk=10 --no-eigen --threads=2 diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 2daec23e7a..911392b2b7 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -146,7 +146,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.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(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)") print("") @@ -321,10 +321,6 @@ def parseopts(args): time.sleep(1.0) 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()): print("Deleting %s" % (GetOutputDir())) shutil.rmtree(GetOutputDir()) @@ -1075,10 +1071,6 @@ def CompileCxx(obj,src,opts): if GetTargetArch() == 'x64': 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) oscmd(cmd) else: diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index fb31536fad..a5c14d1d7d 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -2289,16 +2289,17 @@ def SdkLocateVisualStudio(version=(10,0)): print("Using MSVC %s" % version_str) -def SdkLocateWindows(version = '7.1'): +def SdkLocateWindows(version=None): if GetTarget() != "windows" or GetHost() != "windows": return - version = version.upper() + if version: + version = version.upper() if version == '10': 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. platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") @@ -2333,7 +2334,7 @@ def SdkLocateWindows(version = '7.1'): # No suitable version found. 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. 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)): platsdk = None - elif version == '8.1': + elif version == '8.1' or not version: platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot81") # Fallback in case we can't read the registry. if not platsdk or not os.path.isdir(platsdk): 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': platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot") else: platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v" + version, "InstallationFolder") + DefSymbol("ALWAYS", "_USING_V110_SDK71_") + if not platsdk or not os.path.isdir(platsdk): # Most common location. Worth a try. platsdk = GetProgramFiles() + "\\Microsoft SDKs\\Windows\\v" + version