Script to select the prefered toolchains

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

@ -26,6 +26,7 @@
"MSVC/v90/x86",
"MSVC/v100/x86",
"MSVC/v80/x86"
]
],
"Server": { "OS": "Ubuntu20" }
}
}

@ -26,8 +26,9 @@ for ts in SortedToolsets:
toolchain["Platform"] = platform
toolchain["Toolset"] = ts
toolchain["Prefix"] = FindVSPrefixPaths(ts, platform)
if not len(toolchain["Prefix"]):
toolchain["Hunter"] = True
if not len(toolchain["Prefix"]) and vs["Version"] >= 14:
toolchain["Hunter"] = vs["Version"] >= 14
toolchain["EnvPath"] = FindBinPaths(toolchain["Prefix"])
toolchain["Version"] = vs["Version"]
if platform == "x64":
toolchain["OS"] = "Win64"
@ -35,6 +36,7 @@ for ts in SortedToolsets:
else:
toolchain["OS"] = "Win32"
toolchain["VCVars"] = FindVCVars32(vs["Path"])
if toolchain["VCVars"] and (len(toolchain["Prefix"]) or "Hunter" in toolchain):
Toolchains["MSVC/" + ts + "/" + platform] = toolchain
with open(os.path.join(NeLConfigDir, "toolchains_default.json"), 'w') as fo:

@ -50,7 +50,6 @@ def FindPrefixPaths(externalDir):
return False
tempExternal = {}
tempExternalBinaries = {}
# Headers to include
includeSearch = [
@ -97,6 +96,7 @@ def FindPrefixPaths(externalDir):
# The list of folders to potentially pass into the Visual Studio debug PATH env var
def FindBinPaths(prefixPaths):
tempExternalBinaries = {}
for dir in prefixPaths:
for subDir in os.listdir(dir):
if subDir.startswith("."):

@ -0,0 +1,40 @@
# This script finds the best toolchains for each purpose
from common import *
def FindToolchain(filter):
toolchains = {}
for tsn in NeLToolchains:
ts = NeLToolchains[tsn]
okay = True
for k in filter:
if ts[k] != filter[k]:
okay = False
break
if okay:
toolchains[tsn] = ts
preference = NeLConfig["Toolchain"]["Preference"]
for pn in preference:
if pn in toolchains:
return pn
res = None
bestVersion = 0
for tsn in toolchains:
ts = NeLToolchains[tsn]
if ts["Version"] > bestVersion:
res = tsn
return res
NeLToolchainWin32 = FindToolchain({ "OS": "Win32" })
NeLToolchainWin64 = FindToolchain({ "OS": "Win64" })
NeLToolchainServer = FindToolchain(NeLConfig["Toolchain"]["Server"])
print("Win32:")
print(NeLToolchainWin32)
print("Win64:")
print(NeLToolchainWin64)
print("Server:")
print(NeLToolchainServer)
# end of file

@ -126,6 +126,8 @@ def FindVCVars64(path):
return [ allVars, "x64" ]
return
# TODO: FindDirectX SDK optimized per version. If prefered SDK not available, just return blank
del ProcessYearPath
del VSVersions
del VSMajor

@ -1 +1,2 @@
..\..\..\external\python27\python.exe configure_toolchains.py
..\..\..\external\python27\python.exe find_toolchain.py

Loading…
Cancel
Save