mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
[VS2017] Add powershell script to find any MSBuild with C++ support
This commit is contained in:
parent
bb639bfa9c
commit
e6c127511e
32
scripts/findAnyMSBuildWithCppPlatformToolset.ps1
Normal file
32
scripts/findAnyMSBuildWithCppPlatformToolset.ps1
Normal file
@ -0,0 +1,32 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
|
||||
)
|
||||
|
||||
$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
|
||||
|
||||
# VS2017
|
||||
$VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1
|
||||
foreach ($instance in $VisualStudio2017InstallationInstances)
|
||||
{
|
||||
$VCFolder= "$instance\VC\Tools\MSVC\"
|
||||
|
||||
if (Test-Path $VCFolder)
|
||||
{
|
||||
return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141"
|
||||
}
|
||||
}
|
||||
|
||||
# VS2015
|
||||
$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}"
|
||||
foreach ($ProgramFiles in $CandidateProgramFiles)
|
||||
{
|
||||
$clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe"
|
||||
|
||||
if (Test-Path $clExe)
|
||||
{
|
||||
return "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe","v140"
|
||||
}
|
||||
}
|
||||
|
||||
throw "Could not find MSBuild with C++ support. VS2015 or above with C++ support need to be installed."
|
Loading…
x
Reference in New Issue
Block a user