From e7c092e0bfe43133c148a30e8c353d6c587a8802 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 27 Jan 2022 17:32:11 +0800 Subject: [PATCH] Add preference to config --- tool/quick_start/common_config.py | 4 ++++ tool/quick_start/config_default.json | 11 +++++++++++ tool/quick_start/configure_toolchains.py | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/tool/quick_start/common_config.py b/tool/quick_start/common_config.py index 31558a062..0a2df0412 100644 --- a/tool/quick_start/common_config.py +++ b/tool/quick_start/common_config.py @@ -13,10 +13,14 @@ if not "Paths" in NeLUserConfig: NeLUserConfig["Paths"] = {} if not "Tools" in NeLUserConfig["Paths"]: NeLUserConfig["Paths"]["Tools"] = {} +if not "Toolchain" in NeLUserConfig: + NeLUserConfig["Toolchain"] = {} NeLConfig["Paths"]["Tools"].update(NeLUserConfig["Paths"]["Tools"]) NeLUserConfig["Paths"]["Tools"] = NeLConfig["Paths"]["Tools"] NeLConfig["Paths"].update(NeLUserConfig["Paths"]) NeLUserConfig["Paths"] = NeLConfig["Paths"] +NeLConfig["Toolchain"].update(NeLUserConfig["Toolchain"]) +NeLUserConfig["Toolchain"] = NeLConfig["Toolchain"] NeLConfig.update(NeLUserConfig) fi.close() diff --git a/tool/quick_start/config_default.json b/tool/quick_start/config_default.json index 19fd9b50f..f6ff5082c 100644 --- a/tool/quick_start/config_default.json +++ b/tool/quick_start/config_default.json @@ -16,5 +16,16 @@ "phpMyAdmin": "external/phpmyadmin", "3dsMax": "C:\\Program Files\\Autodesk\\3ds Max 2022" } + }, + "Toolchain": { + "Preference": [ + "MSVC/v143/x64", + "MSVC/v142/x64", + "MSVC/v141/x64", + "MSVC/v140/x64", + "MSVC/v90/x86", + "MSVC/v100/x86", + "MSVC/v80/x86" + ] } } \ No newline at end of file diff --git a/tool/quick_start/configure_toolchains.py b/tool/quick_start/configure_toolchains.py index 8cce1a052..a49333f71 100644 --- a/tool/quick_start/configure_toolchains.py +++ b/tool/quick_start/configure_toolchains.py @@ -26,6 +26,13 @@ for ts in SortedToolsets: toolchain["Platform"] = platform toolchain["Toolset"] = ts toolchain["Prefix"] = FindVSPrefixPaths(ts, platform) + if not len(toolchain["Prefix"]): + toolchain["Hunter"] = True + toolchain["Version"] = vs["Version"] + if platform == "x64": + toolchain["OS"] = "Win64" + else: + toolchain["OS"] = "Win32" Toolchains["MSVC/" + ts + "/" + platform] = toolchain with open(os.path.join(NeLConfigDir, "toolchains_default.json"), 'w') as fo: