-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
34 lines (32 loc) · 1.27 KB
/
build.ps1
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
[CmdletBinding()]
Param(
[ValidateSet("amd64", "x86", "arm64", "arm")]
[string[]]$Archs = $Env:PROCESSOR_ARCHITECTURE,
[ValidateSet("lz4", "lzo", "openssl", "pkcs11-helper")]
[string[]]$Dependents = @("lz4", "lzo", "openssl", "pkcs11-helper"),
[switch]$UseTongsuo
)
if ($MyInvocation.InvocationName -eq "&") {
$env:BuildScriptPath = (Get-Item $MyInvocation.PSScriptRoot).FullName
} else {
$env:BuildScriptPath = (Get-Item (Split-Path $MyInvocation.InvocationName)).FullName
}
$env:BuildScriptModulesPath = Join-Path $env:BuildScriptPath "modules"
Import-Module "$env:BuildScriptModulesPath/environment" -DisableNameChecking -Verbose:$false
Import-Module "$env:BuildScriptModulesPath/common" -DisableNameChecking -Verbose:$false
Import-Module "$env:BuildScriptModulesPath/dependent" -DisableNameChecking -Verbose:$false
New-Dictoray $BuildDir -CleanUp | Out-Host
foreach($dependent in $Dependents)
{
if ($UseTongsuo -and ($dependent -eq "openssl")) {
$dependent = "tongsuo"
}
$buildScriptPath = Join-Path $env:BuildScriptPath "build-$dependent.ps1"
$parameters = @{
"Archs" = $Archs
}
if(Get-HasParameter $buildScriptPath "UseTongsuo") {
$parameters["UseTongsuo"] = $UseTongsuo
}
&$buildScriptPath @parameters
}