Find VCVars

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

@ -31,8 +31,10 @@ for ts in SortedToolsets:
toolchain["Version"] = vs["Version"] toolchain["Version"] = vs["Version"]
if platform == "x64": if platform == "x64":
toolchain["OS"] = "Win64" toolchain["OS"] = "Win64"
toolchain["VCVars"] = FindVCVars64(vs["Path"])
else: else:
toolchain["OS"] = "Win32" toolchain["OS"] = "Win32"
toolchain["VCVars"] = FindVCVars32(vs["Path"])
Toolchains["MSVC/" + ts + "/" + platform] = toolchain Toolchains["MSVC/" + ts + "/" + platform] = toolchain
with open(os.path.join(NeLConfigDir, "toolchains_default.json"), 'w') as fo: with open(os.path.join(NeLConfigDir, "toolchains_default.json"), 'w') as fo:

@ -108,6 +108,24 @@ for yearVersion in os.listdir("C:\\Program Files\\Microsoft Visual Studio"):
ProcessYearPath(yearVersion, yearPath) ProcessYearPath(yearVersion, yearPath)
del 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 ProcessYearPath
del VSVersions del VSVersions
del VSMajor del VSMajor

Loading…
Cancel
Save