40 lines
726 B
Lua
40 lines
726 B
Lua
local vsvar = {}
|
|
|
|
local function exists(mpath)
|
|
local file = io.open(mpath, "r")
|
|
if file then
|
|
io.close(file)
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function vsvar.get(config)
|
|
local vs2017_x64 = "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build/vcvars64.bat"
|
|
if exists(vs2017_x64) then
|
|
table.insert(config, {
|
|
label = "vs2017_x64",
|
|
args = {
|
|
"cmd.exe",
|
|
"/k",
|
|
vs2017_x64,
|
|
},
|
|
})
|
|
end
|
|
|
|
local vs2022_x64 = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat"
|
|
if exists(vs2022_x64) then
|
|
table.insert(config, {
|
|
label = "vs2022_x64",
|
|
args = {
|
|
"cmd.exe",
|
|
"/k",
|
|
vs2022_x64,
|
|
},
|
|
})
|
|
end
|
|
end
|
|
|
|
return vsvar
|