mirror of https://github.com/aminya/setup-cpp
fix: support visual studio 2022
This commit is contained in:
parent
61a3c6cd92
commit
798452a83f
|
@ -15,6 +15,7 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
|
- windows-2022
|
||||||
- windows-2019
|
- windows-2019
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -4,6 +4,20 @@ import { setupMSVC } from "../msvc"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
describe("setup-msvc", () => {
|
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 () => {
|
it("should setup msvc 2019", async () => {
|
||||||
try {
|
try {
|
||||||
if (process.platform !== "win32") {
|
if (process.platform !== "win32") {
|
||||||
|
|
|
@ -51,6 +51,12 @@ export async function setupMSVC(
|
||||||
await setupChocoPack("visualstudio2019buildtools", "16.11.7.0", [])
|
await setupChocoPack("visualstudio2019buildtools", "16.11.7.0", [])
|
||||||
}
|
}
|
||||||
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"
|
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 {
|
} else {
|
||||||
error(`The given MSVC versions ${versionGiven} is not supported yet.`)
|
error(`The given MSVC versions ${versionGiven} is not supported yet.`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue