* Add UWP (and ARM64) targets

* Use AppPlatform instead of Architecture; pass arguments as arrays to LocalBuild
This commit is contained in:
tudorms 2020-08-11 00:52:29 -07:00 коммит произвёл Julio C. Rocha
Родитель 48d817a6dd
Коммит 08e9c31ea4
7 изменённых файлов: 73 добавлений и 166 удалений

Просмотреть файл

@ -1,5 +1,6 @@
parameters:
outputPath:
appPlatform:
steps:
- task: PowerShell@2
@ -30,6 +31,7 @@ steps:
-SourcesPath:$(Build.SourcesDirectory)
-Platform:$(BuildPlatform)
-Configuration:$(BuildConfiguration)
-AppPlatform:${{parameters.appPlatform}}
- task: PublishBuildArtifacts@1
displayName: "Publish artifacts"

Просмотреть файл

@ -1,10 +1,15 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Set V8_ARCH to "win32" for desktop builds -->
<V8AppPlatform Condition="'$(V8AppPlatform)' == ''">uwp</V8AppPlatform>
<V8Platform Condition="'$(V8Platform)' == ''">$(Platform)</V8Platform>
<!-- Fix platform name (win32 should be x86) -->
<V8Platform Condition="'$(V8Platform)' == 'Win32'">x86</V8Platform>
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)' == 'Debug' And '$(Platform)' == 'x64'">$(MSBuildThisFileDirectory)..\..\lib\Debug\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)' == 'Release' And '$(Platform)' == 'x64'">$(MSBuildThisFileDirectory)..\..\lib\Release\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)' == 'Debug' And ('$(Platform)' == 'Win32' Or '$(Platform)' == 'x86')">$(MSBuildThisFileDirectory)..\..\lib\Debug\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)' == 'Release' And ('$(Platform)' == 'Win32' Or '$(Platform)' == 'x86')">$(MSBuildThisFileDirectory)..\..\lib\Release\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)..\..\lib\$(V8AppPlatform)\$(Configuration)\$(V8Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>v8jsi.dll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>v8jsi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
@ -12,20 +17,8 @@
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug' And '$(Platform)' == 'x64' And '$(V8JSI_NODLLCOPY)' == ''">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\Debug\x64\v8jsi.dll" />
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\Debug\x64\v8jsi.dll.pdb" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release' And '$(Platform)' == 'x64' And '$(V8JSI_NODLLCOPY)' == ''">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\Release\x64\v8jsi.dll" />
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\Release\x64\v8jsi.dll.pdb" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug' And ('$(Platform)' == 'Win32' Or '$(Platform)' == 'x86') And '$(V8JSI_NODLLCOPY)' == ''">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\Debug\x86\v8jsi.dll" />
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\Debug\x86\v8jsi.dll.pdb" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release' And ('$(Platform)' == 'Win32' Or '$(Platform)' == 'x86') And '$(V8JSI_NODLLCOPY)' == ''">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\Release\x86\v8jsi.dll" />
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\Release\x86\v8jsi.dll.pdb" />
<ItemGroup Condition="'$(V8JsiNoDLLCopy)' == ''">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\$(V8AppPlatform)\$(Configuration)\$(V8Platform)\v8jsi.dll" />
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\$(V8AppPlatform)\$(Configuration)\$(V8Platform)\v8jsi.dll.pdb" />
</ItemGroup>
</Project>

Просмотреть файл

@ -22,21 +22,43 @@ jobs:
X64Debug:
BuildConfiguration: Debug
BuildPlatform: x64
AppPlatform: win32
X86Debug:
BuildConfiguration: Debug
BuildPlatform: x86
AppPlatform: win32
X64Release:
BuildConfiguration: Release
BuildPlatform: x64
AppPlatform: win32
X86Release:
BuildConfiguration: Release
BuildPlatform: x86
#X64Release-Clang:
# BuildConfiguration: Release-Clang
# BuildPlatform: x64
#X86Release-Clang:
# BuildConfiguration: Release-Clang
# BuildPlatform: x86
AppPlatform: win32
UWPX64Debug:
BuildConfiguration: Debug
BuildPlatform: x64
AppPlatform: uwp
UWPX86Debug:
BuildConfiguration: Debug
BuildPlatform: x86
AppPlatform: uwp
UWPARM64Debug:
BuildConfiguration: Debug
BuildPlatform: arm64
AppPlatform: uwp
UWPX64Release:
BuildConfiguration: Release
BuildPlatform: x64
AppPlatform: uwp
UWPX86Release:
BuildConfiguration: Release
BuildPlatform: x86
AppPlatform: uwp
UWPARM64Release:
BuildConfiguration: Release
BuildPlatform: arm64
AppPlatform: uwp
steps:
- task: UsePythonVersion@0
@ -47,6 +69,7 @@ jobs:
- template: .ado/build-dll.yml
parameters:
outputPath: $(Build.ArtifactStagingDirectory)
appPlatform: $(AppPlatform)
- job: V8JsiPublishNuget
dependsOn:

Просмотреть файл

@ -1,4 +1,4 @@
{
"version": "0.3.2",
"v8ref": "refs/branch-heads/8.4"
"version": "0.3.3",
"v8ref": "refs/branch-heads/8.5"
}

Просмотреть файл

@ -1,16 +1,17 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
param(
[string]$Platform = "x64", #"arm64",
[string]$Configuration = "Debug", # "UWP-Release" "Release-Clang"
[string]$SourcesPath = $PSScriptRoot,
[string]$OutputPath = "$PSScriptRoot\out",
[ValidateSet("x64", "x86", "arm64")]
[String[]]$Platform = @("x64"),
[ValidateSet("debug", "release")]
[String[]]$Configuration = @("debug"),
[ValidateSet("win32", "uwp")]
[String[]]$AppPlatform = @("win32"),
[bool]$Setup = $true
)
$OutputPath = "$PSScriptRoot\out"
$SourcesPath = $PSScriptRoot
$Platforms = "x64", "x86"#, "arm64"
$Configurations = "Debug", "Release", "UWP-Release"#, "Release-Clang", "EXPERIMENTAL-libcpp-Clang"
if ($Setup) {
Write-Host "Downloading environment..."
& ".\scripts\download_depottools.ps1" -SourcesPath $SourcesPath
@ -21,7 +22,7 @@ if ($Setup) {
}
Write-Host "Fetching code..."
& ".\scripts\fetch_code.ps1" -SourcesPath $SourcesPath -OutputPath $OutputPath -Configuration $Configuration
& ".\scripts\fetch_code.ps1" -SourcesPath $SourcesPath -OutputPath $OutputPath -Configuration $Configuration[0]
if (!$?) {
Write-Host "Failed to retrieve the v8 code"
@ -29,17 +30,14 @@ if ($Setup) {
}
}
if ($Platform -like "all") {
foreach ($Plat in $Platforms) {
foreach ($Config in $Configurations) {
Write-Host "Building $Plat $Config..."
& ".\scripts\build.ps1" -SourcesPath $SourcesPath -OutputPath $OutputPath -Platform $Plat -Configuration $Config
foreach ($Plat in $Platform) {
foreach ($Config in $Configuration) {
foreach ($AppPlat in $AppPlatform) {
Write-Host "Building $AppPlat $Plat $Config..."
& ".\scripts\build.ps1" -SourcesPath $SourcesPath -OutputPath $OutputPath -Platform $Plat -Configuration $Config -AppPlatform $AppPlat
}
}
}
else {
& ".\scripts\build.ps1" -SourcesPath $SourcesPath -OutputPath $OutputPath -Platform $Platform -Configuration $Configuration
}
if (!$?) {
Write-Host "Build failure"

Просмотреть файл

@ -1,112 +0,0 @@
param (
[Parameter(Mandatory=$true)]
[string[]] $Components,
[uri] $InstallerUri = "https://aka.ms/vs/16/release/vs_enterprise.exe",
[string] $VsInstaller = "${env:System_DefaultWorkingDirectory}\vs_Enterprise.exe",
[string] $VsInstallOutputDir = "${env:System_DefaultWorkingDirectory}\vs",
[System.IO.FileInfo] $VsInstallPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise",
[System.IO.FileInfo] $VsInstallerPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer",
[switch] $Collect = $false,
[switch] $Cleanup = $false,
[switch] $UseWebInstaller = $false,
[string] $OutputPath = "$PSScriptRoot\out"
)
$Components | ForEach-Object {
$componentList += '--add', $_
}
$LocalVsInstaller = "$VsInstallerPath\vs_installershell.exe"
$UseWebInstaller = $UseWebInstaller -or -not (Test-Path -Path "$LocalVsInstaller")
if ($UseWebInstaller) {
Write-Host "Downloading web installer..."
Invoke-WebRequest -Method Get `
-Uri $InstallerUri `
-OutFile $VsInstaller
New-Item -ItemType directory -Path $VsInstallOutputDir
Write-Host "Running web installer to download requested components..."
Start-Process `
-FilePath "$VsInstaller" `
-ArgumentList ( `
'--layout', "$VsInstallOutputDir",
'--wait',
'--norestart',
'--quiet' + `
$componentList
) `
-Wait `
-PassThru
Write-Host "Running downloaded VS installer to add requested components..."
Start-Process `
-FilePath "$VsInstallOutputDir\vs_Enterprise.exe" `
-ArgumentList (
'modify',
'--installPath', "`"$VsInstallPath`"" ,
'--wait',
'--norestart',
'--quiet' + `
$componentList
) `
-Wait `
-PassThru `
-OutVariable returnCode
if ($Cleanup) {
Write-Host "Cleaning up..."
Remove-Item -Path $VsInstaller
Remove-Item -Path $VsInstallOutputDir -Recurse
}
} else {
Write-Host "Downloading latest Bootstrapper to update local installer..."
Invoke-WebRequest -Method Get -Uri $InstallerUri -OutFile $VsInstaller
Start-Process `
-FilePath "$VsInstaller" `
-ArgumentList ( '--update', '--wait', '--quiet' ) `
-Wait `
-PassThru
Write-Host "Running local installer to add requested components..."
Start-Process `
-FilePath "$LocalVsInstaller" `
-ArgumentList (
'modify',
'--installPath', "`"$VsInstallPath`"" ,
'--norestart',
'--quiet' + `
$componentList
) `
-Wait `
-OutVariable returnCode
}
if ($Collect) {
Invoke-WebRequest -Method Get `
-Uri 'https://download.microsoft.com/download/8/3/4/834E83F6-C377-4DCE-A757-69A418B6C6DF/Collect.exe' `
-OutFile ${env:System_DefaultWorkingDirectory}\Collect.exe
# Should generate ${env:Temp}\vslogs.zip
Start-Process `
-FilePath "${env:System_DefaultWorkingDirectory}\Collect.exe" `
-Wait `
-PassThru
New-Item -ItemType Directory -Force ${env:System_DefaultWorkingDirectory}\vslogs
Expand-Archive -Path ${env:TEMP}\vslogs.zip -DestinationPath ${env:System_DefaultWorkingDirectory}\vslogs\
Copy-Item -Path ${env:TEMP}\vslogs.zip -Destination $OutputPath
Write-Host "VC versions after installation:"
Get-ChildItem -Name "$VsInstallPath\VC\Tools\MSVC\"
}

Просмотреть файл

@ -4,7 +4,10 @@ param(
[string]$OutputPath = "$PSScriptRoot\out",
[string]$SourcesPath = $PSScriptRoot,
[string]$Platform = "x64",
[string]$Configuration = "Release"
[string]$Configuration = "Release",
[string]$AppPlatform = "win32",
[switch]$UseClang,
[switch]$UseLibCpp
)
$workpath = Join-Path $SourcesPath "build"
@ -22,18 +25,18 @@ if ($Configuration -like "*android") {
$gnargs += ' use_goma=false target_os=\"android\" target_cpu=\"' + $Platform + '\"'
}
else {
if (-not ($Configuration -like "*libcpp*")) {
if (-not ($UseLibCpp)) {
$gnargs += ' use_custom_libcxx=false'
}
if ($Configuration -like "UWP*") {
if ($AppPlatform -eq "uwp") {
# the default target_winuwp_family="app" (which translates to WINAPI_FAMILY=WINAPI_FAMILY_PC_APP) blows up with too many errors
$gnargs += ' target_os=\"winuwp\" target_winuwp_family=\"desktop\"'
}
$gnargs += ' target_cpu=\"' + $Platform + '\"'
if ($Configuration -like "*clang") {
if ($UseClang) {
#TODO (#2): we need to figure out how to actually build DEBUG with clang-cl (won't work today due to STL iterator issues)
$gnargs += ' is_clang=true'
}
@ -54,7 +57,7 @@ else {
$gnargs += ' enable_iterator_debugging=false is_debug=false'
}
$buildoutput = Join-Path $workpath "v8build\v8\out\$Platform\$Configuration"
$buildoutput = Join-Path $workpath "v8build\v8\out\$AppPlatform\$Platform\$Configuration"
Write-Host "gn command line: gn gen $buildoutput --args='$gnargs'"
& gn gen $buildoutput --args="$gnargs"
@ -83,21 +86,21 @@ if (!(Test-Path -Path "$OutputPath\build\native\include\jsi")) {
if (!(Test-Path -Path "$OutputPath\license")) {
New-Item -ItemType "directory" -Path "$OutputPath\license" | Out-Null
}
if (!(Test-Path -Path "$OutputPath\lib\$Configuration\$Platform")) {
New-Item -ItemType "directory" -Path "$OutputPath\lib\$Configuration\$Platform" | Out-Null
if (!(Test-Path -Path "$OutputPath\lib\$AppPlatform\$Configuration\$Platform")) {
New-Item -ItemType "directory" -Path "$OutputPath\lib\$AppPlatform\$Configuration\$Platform" | Out-Null
}
# Binaries
if (!$PSVersionTable.Platform -or $IsWindows) {
Copy-Item "$buildoutput\v8jsi.dll" -Destination "$OutputPath\lib\$Configuration\$Platform"
Copy-Item "$buildoutput\v8jsi.dll.lib" -Destination "$OutputPath\lib\$Configuration\$Platform"
Copy-Item "$buildoutput\v8jsi.dll.pdb" -Destination "$OutputPath\lib\$Configuration\$Platform"
Copy-Item "$buildoutput\v8jsi.dll" -Destination "$OutputPath\lib\$AppPlatform\$Configuration\$Platform"
Copy-Item "$buildoutput\v8jsi.dll.lib" -Destination "$OutputPath\lib\$AppPlatform\$Configuration\$Platform"
Copy-Item "$buildoutput\v8jsi.dll.pdb" -Destination "$OutputPath\lib\$AppPlatform\$Configuration\$Platform"
}
else {
#TODO (#2): .so
}
Copy-Item "$buildoutput\args.gn" -Destination "$OutputPath\lib\$Configuration\$Platform"
Copy-Item "$buildoutput\args.gn" -Destination "$OutputPath\lib\$AppPlatform\$Configuration\$Platform"
# Headers
Copy-Item "$jsigitpath\public\ScriptStore.h" -Destination "$OutputPath\build\native\include\"