diff --git a/tool/quick_start/configure_toolchains.py b/tool/quick_start/configure_toolchains.py index a49333f71..8463bd7d9 100644 --- a/tool/quick_start/configure_toolchains.py +++ b/tool/quick_start/configure_toolchains.py @@ -31,8 +31,10 @@ for ts in SortedToolsets: toolchain["Version"] = vs["Version"] if platform == "x64": toolchain["OS"] = "Win64" + toolchain["VCVars"] = FindVCVars64(vs["Path"]) else: toolchain["OS"] = "Win32" + toolchain["VCVars"] = FindVCVars32(vs["Path"]) Toolchains["MSVC/" + ts + "/" + platform] = toolchain with open(os.path.join(NeLConfigDir, "toolchains_default.json"), 'w') as fo: diff --git a/tool/quick_start/find_vstudio.py b/tool/quick_start/find_vstudio.py index 7ddc0f040..7b3098787 100644 --- a/tool/quick_start/find_vstudio.py +++ b/tool/quick_start/find_vstudio.py @@ -108,6 +108,24 @@ for yearVersion in os.listdir("C:\\Program Files\\Microsoft Visual Studio"): ProcessYearPath(yearVersion, yearPath) del yearPath +def FindVCVars32(path): + auxVars = os.path.join(path, "VC\\Auxiliary\\Build\\vcvars32.bat") + if os.path.isfile(auxVars): + return [ auxVars ] + allVars = os.path.join(path, "VC\\vcvarsall.bat") + if os.path.isfile(allVars): + return [ allVars, "x86" ] + return + +def FindVCVars64(path): + auxVars = os.path.join(path, "VC\\Auxiliary\\Build\\vcvars64.bat") + if os.path.isfile(auxVars): + return [ auxVars ] + allVars = os.path.join(path, "VC\\vcvarsall.bat") + if os.path.isfile(allVars): + return [ allVars, "x64" ] + return + del ProcessYearPath del VSVersions del VSMajor