fix: support visual studio 2022

This commit is contained in:
Amin Yahyaabadi 2022-02-01 18:28:44 -08:00
parent 61a3c6cd92
commit 798452a83f
5 changed files with 23 additions and 2 deletions

View File

@ -15,6 +15,7 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2022
- windows-2019
- ubuntu-20.04
- macos-10.15

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,20 @@ import { setupMSVC } from "../msvc"
jest.setTimeout(300000)
describe("setup-msvc", () => {
it("should setup msvc 2022", async () => {
try {
if (process.platform !== "win32") {
return
}
await setupMSVC("2022", "", process.arch)
await testBin("cl", [])
console.log(which("cl"))
} catch (e) {
// TODO
console.error(e)
}
})
it("should setup msvc 2019", async () => {
try {
if (process.platform !== "win32") {

View File

@ -51,6 +51,12 @@ export async function setupMSVC(
await setupChocoPack("visualstudio2019buildtools", "16.11.7.0", [])
}
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"
} else if (version === "17.0") {
toolset = undefined
if (!installed) {
await setupChocoPack("visualstudio2022buildtools", "117.0.5.0", [])
}
VCTargetsPath = undefined
} else {
error(`The given MSVC versions ${versionGiven} is not supported yet.`)
}