Select best DX SDK for OS compatibility by toolchain

feature/quick-start-py
kaetemi 3 years ago
parent 94c210946d
commit f57a5260bb
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -14,7 +14,7 @@
"Nginx": "external/nginx",
"PHP": "external/php",
"phpMyAdmin": "external/phpmyadmin",
"3dsMax": "C:\\Program Files\\Autodesk\\3ds Max 2022"
"3dsMax": ""
}
},
"Toolchain": {
@ -27,6 +27,13 @@
"MSVC/v100/x86",
"MSVC/v80/x86"
],
"Server": { "OS": "Ubuntu20" }
"Server": { "OS": "Ubuntu20" },
"Options": [
{
"Filter": { "Compiler": "MSVC" },
"CMake": [ "-DCUSTOM_FLAGS=/MP3" ],
"MSBuild": [ "/m:2" ]
}
]
}
}

@ -22,14 +22,25 @@ for ts in SortedToolsets:
vs = ByToolset[ts]
for platform in VSPlatforms:
toolchain = {}
toolchain["Compiler"] = "MSVC"
toolchain["Generator"] = vs["Name"]
toolchain["Platform"] = platform
toolchain["Toolset"] = ts
toolchain["Prefix"] = FindVSPrefixPaths(ts, platform)
if not len(toolchain["Prefix"]) and vs["Version"] >= 14:
toolchain["Hunter"] = vs["Version"] >= 14
toolchain["CMake"] = []
if vs["Version"] < 14:
toolchain["CMake"] += [ "-DWINSDK_VERSION=6.0A" ]
toolchain["EnvPath"] = FindBinPaths(toolchain["Prefix"])
toolchain["Version"] = vs["Version"]
directXSdk = FindDirectXSDK(vs["Version"])
if directXSdk:
toolchain["DirectXSDK"] = directXSdk
if HasXAudio2(directXSdk):
toolchain["HasXAudio2"] = True
if vs["HasMFC"]:
toolchain["HasMFC"] = True
if platform == "x64":
toolchain["OS"] = "Win64"
toolchain["VCVars"] = FindVCVars64(vs["Path"])

@ -64,11 +64,11 @@ for majorVersion in range(8, 15):
folderA = "C:\\Program Files (x86)\\Microsoft Visual Studio " + str(majorVersion)
folderB = folderA + ".0"
if os.path.isfile(os.path.join(folderA, "Common7\\IDE\\VCExpress.exe")):
FoundVisualStudio += [ { "Name": "Visual Studio " + str(majorVersion) + " " + str(VSVersions[majorVersion]), "DisplayName": "Visual C++ " + str(VSVersions[majorVersion]) + " Express", "Path": folderA, "Version": majorVersion, "Toolset": "v" + str(majorVersion) + "0", "HasMFC": HasMFC(folderB) } ]
FoundVisualStudio += [ { "Name": "Visual Studio " + str(majorVersion) + " " + str(VSVersions[majorVersion]), "DisplayName": "Visual C++ " + str(VSVersions[majorVersion]) + " Express", "Path": folderA, "Version": majorVersion, "Toolset": "v" + str(majorVersion) + "0", "HasMFC": HasMFC(folderA) } ]
if os.path.isfile(os.path.join(folderB, "Common7\\IDE\VCExpress.exe")):
FoundVisualStudio += [ { "Name": "Visual Studio " + str(majorVersion) + " " + str(VSVersions[majorVersion]), "DisplayName": "Visual C++ " + str(VSVersions[majorVersion]) + " Express", "Path": folderB, "Version": majorVersion, "Toolset": "v" + str(majorVersion) + "0", "HasMFC": HasMFC(folderB) } ]
if os.path.isfile(os.path.join(folderA, "Common7\\IDE\\devenv.exe")):
FoundVisualStudio += [ { "Name": "Visual Studio " + str(majorVersion) + " " + str(VSVersions[majorVersion]), "DisplayName": "Visual Studio " + str(VSVersions[majorVersion]), "Path": folderA, "Version": majorVersion, "Toolset": "v" + str(majorVersion) + "0", "HasMFC": HasMFC(folderB) } ]
FoundVisualStudio += [ { "Name": "Visual Studio " + str(majorVersion) + " " + str(VSVersions[majorVersion]), "DisplayName": "Visual Studio " + str(VSVersions[majorVersion]), "Path": folderA, "Version": majorVersion, "Toolset": "v" + str(majorVersion) + "0", "HasMFC": HasMFC(folderA) } ]
if os.path.isfile(os.path.join(folderB, "Common7\\IDE\\devenv.exe")):
FoundVisualStudio += [ { "Name": "Visual Studio " + str(majorVersion) + " " + str(VSVersions[majorVersion]), "DisplayName": "Visual Studio " + str(VSVersions[majorVersion]), "Path": folderB, "Version": majorVersion, "Toolset": "v" + str(majorVersion) + "0", "HasMFC": HasMFC(folderB) } ]
del folderA
@ -126,7 +126,25 @@ def FindVCVars64(path):
return [ allVars, "x64" ]
return
# TODO: FindDirectX SDK optimized per version. If prefered SDK not available, just return blank
# FindDirectX SDK, optimized for compatibility per version. If prefered SDK not available, just return blank
# https://archive.org/details/directxsdks
def FindDirectXSDK(version):
if version == 8: # 2005, Windows 98 compatibility, DirectX 9.0c (October 2006)
if os.path.isfile("C:\\Program Files (x86)\\Microsoft DirectX SDK (October 2006)\\Include\\d3d9.h"):
return "C:\\Program Files (x86)\\Microsoft DirectX SDK (October 2006)"
elif version == 9: # 2008, Windows 2000 compatibility, DirectX 9.0c (June 2008) and unofficially (February 2010)
if os.path.isfile("C:\\Program Files (x86)\\Microsoft DirectX SDK (February 2010)\\Include\\d3d9.h"):
return "C:\\Program Files (x86)\\Microsoft DirectX SDK (February 2010)"
elif os.path.isfile("C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2008)\\Include\\d3d9.h"):
return "C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2008)"
if os.path.isfile("C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Include\\d3d9.h"):
return "C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)"
return
def HasXAudio2(path):
if not path:
return False
return os.path.isfile(os.path.join(path, "Include\\XAudio2.h"))
del ProcessYearPath
del VSVersions

Loading…
Cancel
Save