forked from ffmpeginteropx/FFmpegInteropX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart-DevShell.ps1
More file actions
74 lines (58 loc) · 2.19 KB
/
Start-DevShell.ps1
File metadata and controls
74 lines (58 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
param(
[ValidateSet('x86', 'x64', 'ARM', 'ARM64')]
[string] $Platform = 'x86',
<#
Example values:
14.1
14.2
14.16
14.16.27023
14.23.27820
Note. The PlatformToolset will be inferred from this value ('v141', 'v142'...)
#>
[version] $VcVersion = '14.2',
[ValidateSet('UWP', 'Desktop')]
[string] $WindowsTarget = 'UWP',
<#
Example values:
8.1
10.0.15063.0
10.0.17763.0
10.0.18362.0
#>
[version] $WindowsTargetPlatformVersion = '10.0.19041.0',
[System.IO.DirectoryInfo] $VSInstallerFolder = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer",
# Set the search criteria for VSWHERE.EXE.
[string[]] $VsWhereCriteria = '-latest',
[switch] $InProcess
)
if ($InProcess)
{
Write-Host
Write-Host "Starting DevShell $Platform $WindowsTarget $WindowsTargetPlatformVersion $VcVersion"
Write-Host
# Stop on all PowerShell command errors
$ErrorActionPreference = "Stop"
[System.IO.DirectoryInfo] $vsLatestPath = `
& "$VSInstallerFolder\vswhere.exe" `
$VsWhereCriteria `
-property installationPath `
-products * `
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Write-Host "Visual Studio Installation folder: [$vsLatestPath]"
$hostArch = ( 'x86', 'x64' )[ [System.Environment]::Is64BitOperatingSystem ]
$targetArch = $Platform.ToLower()
Write-Host
Write-Host "Building FFmpeg for Windows 10 ($WindowsTarget) ${Platform}..."
Write-Host
# Load environment from VCVARS.
Import-Module "$VsLatestPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell `
-VsInstallPath $VsLatestPath `
-StartInPath "$PWD" `
-DevCmdArguments "-arch=$targetArch -host_arch=$hostArch -winsdk=$WindowsTargetPlatformVersion -vcvars_ver=$VcVersion -app_platform=$WindowsTarget"
}
else
{
powershell -NoExit -Command "$PSCommandPath -Platform $Platform -VcVersion $VcVersion -WindowsTarget $WindowsTarget -WindowsTargetPlatformVersion $WindowsTargetPlatformVersion -VSInstallerFolder '$VSInstallerFolder' -VsWhereCriteria $VsWhereCriteria -InProcess"
}