diff --git a/tool/quick_start/config_default.json b/tool/quick_start/config_default.json index f6ff5082c..d4cbac674 100644 --- a/tool/quick_start/config_default.json +++ b/tool/quick_start/config_default.json @@ -26,6 +26,7 @@ "MSVC/v90/x86", "MSVC/v100/x86", "MSVC/v80/x86" - ] + ], + "Server": { "OS": "Ubuntu20" } } } \ No newline at end of file diff --git a/tool/quick_start/configure_toolchains.py b/tool/quick_start/configure_toolchains.py index 8463bd7d9..76e4bf5e0 100644 --- a/tool/quick_start/configure_toolchains.py +++ b/tool/quick_start/configure_toolchains.py @@ -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,7 +36,8 @@ for ts in SortedToolsets: else: toolchain["OS"] = "Win32" toolchain["VCVars"] = FindVCVars32(vs["Path"]) - Toolchains["MSVC/" + ts + "/" + platform] = toolchain + 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: json.dump(Toolchains, fo, indent=2) diff --git a/tool/quick_start/find_external.py b/tool/quick_start/find_external.py index a9e8c0b3b..fa8d93159 100644 --- a/tool/quick_start/find_external.py +++ b/tool/quick_start/find_external.py @@ -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("."): diff --git a/tool/quick_start/find_toolchain.py b/tool/quick_start/find_toolchain.py new file mode 100644 index 000000000..3b3061a35 --- /dev/null +++ b/tool/quick_start/find_toolchain.py @@ -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 diff --git a/tool/quick_start/find_vstudio.py b/tool/quick_start/find_vstudio.py index 7b3098787..3894572fb 100644 --- a/tool/quick_start/find_vstudio.py +++ b/tool/quick_start/find_vstudio.py @@ -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 diff --git a/tool/quick_start/test.bat b/tool/quick_start/test.bat index 0cccac36c..9ad55e2b4 100644 --- a/tool/quick_start/test.bat +++ b/tool/quick_start/test.bat @@ -1 +1,2 @@ ..\..\..\external\python27\python.exe configure_toolchains.py +..\..\..\external\python27\python.exe find_toolchain.py