11# requires -Version 5
22
33param (
4- [ValidateSet (" vs2012 " , " vs2013 " , " vs2015 " , " vs2017 " , " vs2019 " , " nupkg" , " nupkg-only" )]
4+ [ValidateSet (" vs2019 " , " vs2021 " , " nupkg" , " nupkg-only" )]
55 [Parameter (Position = 0 )]
66 [string ] $Target = " nupkg" ,
77
1414 [string ] $CefBinaryDir = " ../cefsource/chromium/src/cef/binary_distrib/" ,
1515
1616 [Parameter (Position = 3 )]
17- $CefVersion = " 93 .0.1+g2d46bb7 +chromium-93 .0.4577.15 " ,
17+ $CefVersion = " 94 .0.5+g506b164 +chromium-94 .0.4606.41 " ,
1818
1919 [ValidateSet (" tar.bz2" , " zip" , " 7z" )]
2020 [Parameter (Position = 4 )]
@@ -196,43 +196,31 @@ try
196196 # Create default directory structure
197197 md ' cef\win32' | Out-Null
198198 md ' cef\win32\debug' | Out-Null
199- md ' cef\win32\debug\VS2012' | Out-Null
200- md ' cef\win32\debug\VS2013' | Out-Null
201- md ' cef\win32\debug\VS2015' | Out-Null
202- md ' cef\win32\debug\VS2017' | Out-Null
203199 md ' cef\win32\debug\VS2019' | Out-Null
200+ md ' cef\win32\debug\VS2021' | Out-Null
204201 md ' cef\win32\release' | Out-Null
205- md ' cef\win32\release\VS2012' | Out-Null
206- md ' cef\win32\release\VS2013' | Out-Null
207- md ' cef\win32\release\VS2015' | Out-Null
208- md ' cef\win32\release\VS2017' | Out-Null
209202 md ' cef\win32\release\VS2019' | Out-Null
203+ md ' cef\win32\release\VS2021' | Out-Null
210204 md ' cef\x64' | Out-Null
211205 md ' cef\x64\debug' | Out-Null
212- md ' cef\x64\debug\VS2012' | Out-Null
213- md ' cef\x64\debug\VS2013' | Out-Null
214- md ' cef\x64\debug\VS2015' | Out-Null
215- md ' cef\x64\debug\VS2017' | Out-Null
216206 md ' cef\x64\debug\VS2019' | Out-Null
207+ md ' cef\x64\debug\VS2021' | Out-Null
217208 md ' cef\x64\release' | Out-Null
218- md ' cef\x64\release\VS2012' | Out-Null
219- md ' cef\x64\release\VS2013' | Out-Null
220- md ' cef\x64\release\VS2015' | Out-Null
221- md ' cef\x64\release\VS2017' | Out-Null
222209 md ' cef\x64\release\VS2019' | Out-Null
210+ md ' cef\x64\release\VS2021' | Out-Null
223211 md ' cef\arm64' | Out-Null
224212 md ' cef\arm64\debug' | Out-Null
225- md ' cef\arm64\debug\VS2017' | Out-Null
226213 md ' cef\arm64\debug\VS2019' | Out-Null
214+ md ' cef\arm64\debug\VS2021' | Out-Null
227215 md ' cef\arm64\release' | Out-Null
228- md ' cef\arm64\release\VS2017' | Out-Null
229216 md ' cef\arm64\release\VS2019' | Out-Null
217+ md ' cef\arm64\release\VS2021' | Out-Null
230218 }
231219
232220 function Msvs
233221 {
234222 param (
235- [ValidateSet (' v110 ' , ' v120 ' , ' v140 ' , ' v141 ' , ' v142 ' )]
223+ [ValidateSet (' v142 ' , ' v143 ' )]
236224 [Parameter (Position = 0 , ValueFromPipeline = $true )]
237225 [string ] $Toolchain ,
238226
@@ -251,85 +239,49 @@ try
251239 $VXXCommonTools = $null
252240 $CmakeGenerator = $null
253241
254- switch - Exact ($Toolchain )
242+ $VS_VER = 16 ;
243+ $VS_OFFICIAL_VER = 2019 ;
244+
245+ if ($_ -eq ' v143' )
255246 {
256- ' v110'
257- {
258- if ($env: VS110COMNTOOLS -eq $null )
259- {
260- Die " Visual Studio 2012 was not found"
261- }
262- $VisualStudioVersion = ' 11.0'
263- $VXXCommonTools = Join-Path $env: VS110COMNTOOLS ' ..\..\vc'
264- $CmakeGenerator = ' Visual Studio 11'
265- }
266- ' v120'
267- {
268- if ($env: VS120COMNTOOLS -eq $null )
269- {
270- Die " Visual Studio 2013 was not found"
271- }
272- $VisualStudioVersion = ' 12.0'
273- $VXXCommonTools = Join-Path $env: VS120COMNTOOLS ' ..\..\vc'
274- $CmakeGenerator = ' Visual Studio 12'
275- }
276- ' v140'
247+ $VS_VER = 17 ;
248+ $VS_OFFICIAL_VER = 2021 ;
249+ }
250+
251+ $programFilesDir = (${env: ProgramFiles(x86)} , ${env: ProgramFiles} -ne $null )[0 ]
252+
253+ $vswherePath = Join-Path $programFilesDir ' Microsoft Visual Studio\Installer\vswhere.exe'
254+ # Check if we already have vswhere which is included in newer versions of VS2019/VS2021
255+ if (-not (Test-Path $vswherePath ))
256+ {
257+ Write-Diagnostic " Downloading VSWhere as no install found at $vswherePath "
258+
259+ # Check if we already have a local copy and download if required
260+ $vswherePath = Join-Path $WorkingDir \vswhere.exe
261+
262+ # TODO: Check hash and download if hash differs
263+ if (-not (Test-Path $vswherePath ))
277264 {
278- if ($env: VS140COMNTOOLS -eq $null )
279- {
280- Die " Visual Studio 2015 was not found"
281- }
282- $VisualStudioVersion = ' 14.0'
283- $VXXCommonTools = Join-Path $env: VS140COMNTOOLS ' ..\..\vc'
284- $CmakeGenerator = ' Visual Studio 14'
265+ $client = New-Object System.Net.WebClient;
266+ $client.DownloadFile (' https://github.com/Microsoft/vswhere/releases/download/2.5.2/vswhere.exe' , $vswherePath );
285267 }
286- {($_ -eq ' v141' ) -or ($_ -eq ' v142' )}
287- {
288- $VS_VER = 15 ;
289- $VS_OFFICIAL_VER = 2017 ;
290-
291- if ($_ -eq ' v142' )
292- {
293- $VS_VER = 16 ;
294- $VS_OFFICIAL_VER = 2019 ;
295- }
296-
297- $programFilesDir = (${env: ProgramFiles(x86)} , ${env: ProgramFiles} -ne $null )[0 ]
298-
299- $vswherePath = Join-Path $programFilesDir ' Microsoft Visual Studio\Installer\vswhere.exe'
300- # Check if we already have vswhere which is included in newer versions of VS2017/VS2019
301- if (-not (Test-Path $vswherePath ))
302- {
303- Write-Diagnostic " Downloading VSWhere as no install found at $vswherePath "
304-
305- # Check if we already have a local copy and download if required
306- $vswherePath = Join-Path $WorkingDir \vswhere.exe
307-
308- # TODO: Check hash and download if hash differs
309- if (-not (Test-Path $vswherePath ))
310- {
311- $client = New-Object System.Net.WebClient;
312- $client.DownloadFile (' https://github.com/Microsoft/vswhere/releases/download/2.5.2/vswhere.exe' , $vswherePath );
313- }
314- }
315-
316- Write-Diagnostic " VSWhere path $vswherePath "
268+ }
269+
270+ Write-Diagnostic " VSWhere path $vswherePath "
317271
318- $versionSearchStr = " [$VS_VER .0," + ($VS_VER + 1 ) + " .0)"
319- $VS2017InstallPath = & $vswherePath - version $versionSearchStr - property installationPath
320-
321- Write-Diagnostic " $ ( $VS_OFFICIAL_VER ) InstallPath: $VS2017InstallPath "
322-
323- if ($VS2017InstallPath -eq $null -or ! (Test-Path $VS2017InstallPath ))
324- {
325- Die " Visual Studio $VS_OFFICIAL_VER was not found"
326- }
327-
328- $VisualStudioVersion = " $VS_VER .0"
329- $VXXCommonTools = Join-Path $VS2017InstallPath VC\Auxiliary\Build
330- $CmakeGenerator = " Visual Studio $VS_VER "
331- }
272+ $versionSearchStr = " [$VS_VER .0," + ($VS_VER + 1 ) + " .0)"
273+ $VSInstallPath = & $vswherePath - version $versionSearchStr - property installationPath
274+
275+ Write-Diagnostic " $ ( $VS_OFFICIAL_VER ) InstallPath: $VSInstallPath "
276+
277+ if ($VSInstallPath -eq $null -or ! (Test-Path $VSInstallPath ))
278+ {
279+ Die " Visual Studio $VS_OFFICIAL_VER was not found"
332280 }
281+
282+ $VisualStudioVersion = " $VS_VER .0"
283+ $VXXCommonTools = Join-Path $VSInstallPath VC\Auxiliary\Build
284+ $CmakeGenerator = " Visual Studio $VS_VER "
333285
334286 if ($VXXCommonTools -eq $null -or (-not (Test-Path ($VXXCommonTools ))))
335287 {
458410 function VSX
459411 {
460412 param (
461- [ValidateSet (' v110 ' , ' v120 ' , ' v140 ' , ' v141 ' , ' v142 ' )]
413+ [ValidateSet (' v142 ' , ' v143 ' )]
462414 [Parameter (Position = 0 , ValueFromPipeline = $true )]
463415 [string ] $Toolchain
464416 )
@@ -476,22 +428,19 @@ try
476428 }
477429 Msvs " $Toolchain " ' Release' ' x64'
478430
479- if ($Toolchain -eq ' v141 ' -or $Toolchain -eq ' v142 ' )
431+ if (! $NoDebugBuild )
480432 {
481- if (! $NoDebugBuild )
482- {
483- Msvs " $Toolchain " ' Debug' ' arm64'
484- }
485- Msvs " $Toolchain " ' Release' ' arm64'
433+ Msvs " $Toolchain " ' Debug' ' arm64'
486434 }
435+ Msvs " $Toolchain " ' Release' ' arm64'
487436
488437 Write-Diagnostic " Finished build targeting toolchain $Toolchain "
489438 }
490439
491440 function CreateCefSdk
492441 {
493442 param (
494- [ValidateSet (' v110 ' , ' v120 ' , ' v140 ' , ' v141 ' , ' v142 ' )]
443+ [ValidateSet (' v142 ' , ' v143 ' )]
495444 [Parameter (Position = 0 , ValueFromPipeline = $true )]
496445 [string ] $Toolchain ,
497446
@@ -506,26 +455,11 @@ try
506455
507456 Write-Diagnostic " Creating sdk for $Toolchain "
508457
509- $VisualStudioVersion = $null
510- if ($Toolchain -eq " v142" )
511- {
512- $VisualStudioVersion = " VS2019"
513- }
514- elseif ($Toolchain -eq " v141" )
515- {
516- $VisualStudioVersion = " VS2017"
517- }
518- elseif ($Toolchain -eq " v140" )
519- {
520- $VisualStudioVersion = " VS2015"
521- }
522- elseif ($Toolchain -eq " v110" )
523- {
524- $VisualStudioVersion = " VS2012"
525- }
526- else
458+ $VisualStudioVersion = " VS2019"
459+
460+ if ($Toolchain -eq " v143" )
527461 {
528- $VisualStudioVersion = " VS2013 "
462+ $VisualStudioVersion = " VS2021 "
529463 }
530464
531465 $Arch = ' win32'
541475 $CefArchDir = $CefArm64
542476 }
543477
544- # cef_binary_3.y.z_windows32\out\debug\lib -> cef\win32\debug\vs2013
478+ # cef_binary_3.y.z_windows32\out\debug\lib -> cef\win32\debug\vs2019
545479 Copy-Item $CefArchDir \libcef_dll_wrapper\$Configuration \libcef_dll_wrapper.lib $Cef \$Arch \$Configuration \$VisualStudioVersion | Out-Null
546480
547481 # cef_binary_3.y.z_windows32\debug -> cef\win32\debug
603537 }
604538
605539 $Client = New-Object System.Net.WebClient;
606- $Client.DownloadFile (' https://dist.nuget.org/win-x86-commandline/v5.4 .0/nuget.exe' , $Nuget );
540+ $Client.DownloadFile (' https://dist.nuget.org/win-x86-commandline/v5.11 .0/nuget.exe' , $Nuget );
607541 }
608542 }
609543
940874 {
941875 Nupkg
942876 }
943- " vs2013"
944- {
945- VSX v120
946- }
947- " vs2012"
948- {
949- VSX v110
950- }
951- " vs2015"
952- {
953- VSX v140
954- }
955- " vs2017"
877+ " vs2021"
956878 {
957- VSX v141
879+ VSX v143
958880 }
959881 " vs2019"
960882 {
0 commit comments