Skip to content

Commit 798452a

Browse files
committed
fix: support visual studio 2022
1 parent 61a3c6c commit 798452a

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os:
18+
- windows-2022
1819
- windows-2019
1920
- ubuntu-20.04
2021
- macos-10.15

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/msvc/__tests__/msvc.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ import { setupMSVC } from "../msvc"
44

55
jest.setTimeout(300000)
66
describe("setup-msvc", () => {
7+
it("should setup msvc 2022", async () => {
8+
try {
9+
if (process.platform !== "win32") {
10+
return
11+
}
12+
await setupMSVC("2022", "", process.arch)
13+
await testBin("cl", [])
14+
console.log(which("cl"))
15+
} catch (e) {
16+
// TODO
17+
console.error(e)
18+
}
19+
})
20+
721
it("should setup msvc 2019", async () => {
822
try {
923
if (process.platform !== "win32") {

src/msvc/msvc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ export async function setupMSVC(
5151
await setupChocoPack("visualstudio2019buildtools", "16.11.7.0", [])
5252
}
5353
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"
54+
} else if (version === "17.0") {
55+
toolset = undefined
56+
if (!installed) {
57+
await setupChocoPack("visualstudio2022buildtools", "117.0.5.0", [])
58+
}
59+
VCTargetsPath = undefined
5460
} else {
5561
error(`The given MSVC versions ${versionGiven} is not supported yet.`)
5662
}

0 commit comments

Comments
 (0)