mirror of https://github.com/aminya/setup-cpp
fix: set VCTargetsPath
This commit is contained in:
parent
8555309081
commit
2761be4b10
|
@ -30,11 +30,12 @@ export async function setupMSVC(
|
|||
arch = osArch()
|
||||
): Promise<void> {
|
||||
let toolset: string | undefined
|
||||
let VCTargetsPath: string | undefined
|
||||
if (version === "2015") {
|
||||
toolset = "14.0.25420.1"
|
||||
await setupChocoPack("visualcpp-build-tools", toolset, ["--ignore-dependencies", "--params", "'/IncludeRequired'"])
|
||||
|
||||
const VCTargetsPath = "C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\v140"
|
||||
VCTargetsPath = "C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\v140"
|
||||
if (existsSync(VCTargetsPath)) {
|
||||
exportVariable("VCTargetsPath", VCTargetsPath)
|
||||
}
|
||||
|
@ -44,12 +45,17 @@ export async function setupMSVC(
|
|||
"--package-parameters",
|
||||
"add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive",
|
||||
])
|
||||
VCTargetsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\Microsoft\\VC\\v150"
|
||||
} else if (version === "2019") {
|
||||
toolset = "16.11.2.0"
|
||||
await setupChocoPack("visualstudio2019buildtools", toolset, [
|
||||
"--package-parameters",
|
||||
"add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive",
|
||||
])
|
||||
VCTargetsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Microsoft\\VC\\v160"
|
||||
}
|
||||
if (VCTargetsPath !== undefined && existsSync(VCTargetsPath)) {
|
||||
exportVariable("VCTargetsPath", VCTargetsPath)
|
||||
}
|
||||
setupMSVCDevCmd(getArch(arch), sdk, toolset, uwp, spectre)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue