wezterm/vsvar.lua

40 lines
726 B
Lua
Raw Normal View History

2025-04-06 20:44:32 +08:00
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)
2025-04-07 08:38:08 +08:00
local vs2017_x64 = "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build/vcvars64.bat"
if exists(vs2017_x64) then
2025-04-06 20:44:32 +08:00
table.insert(config, {
2025-04-07 08:38:08 +08:00
label = "vs2017_x64",
2025-04-06 20:44:32 +08:00
args = {
"cmd.exe",
"/k",
2025-04-07 08:38:08 +08:00
vs2017_x64,
2025-04-06 20:44:32 +08:00
},
})
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