Skip to content

update build script for arm #781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: latestw_all
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions contrib/win32/openssh/OpenSSHBuildHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ function Start-OpenSSHBootstrap
[Environment]::SetEnvironmentVariable('Path', $newMachineEnvironmentPath, 'MACHINE')
}

$sdkVersion = Get-Windows10SDKVersion
$sdkVersion = Get-Windows10SDKVersion -NativeHostArch $NativeHostArch
if ($null -eq $sdkVersion)
{
Get-Chocolatey
$packageName = "windows-sdk-10.1"
Write-BuildMsg -AsInfo -Message "$packageName not present. Installing $packageName ..."
choco install $packageName -y --force --limitoutput --execution-timeout 120 2>&1 >> $script:BuildLogFile
# check that sdk was properly installed
$sdkVersion = Get-Windows10SDKVersion
$sdkVersion = Get-Windows10SDKVersion -NativeHostArch $NativeHostArch
if($null -eq $sdkVersion)
{
Write-BuildMsg -AsError -ErrorAction Stop -Message "$packageName installation failed with error code $LASTEXITCODE."
Expand Down Expand Up @@ -524,7 +524,7 @@ function Start-OpenSSHBuild
(Get-Content $f).Replace('#define OPENSSL_HAS_NISTP521 1','') | Set-Content $f
}

$win10SDKVer = Get-Windows10SDKVersion
$win10SDKVer = Get-Windows10SDKVersion -NativeHostArch $NativeHostArch
[XML]$xml = Get-Content $PathTargets
$xml.Project.PropertyGroup.WindowsSDKVersion = $win10SDKVer.ToString()

Expand All @@ -548,7 +548,7 @@ function Start-OpenSSHBuild

if($OneCore)
{
$win10SDKVer = Get-Windows10SDKVersion
$win10SDKVer = Get-Windows10SDKVersion -NativeHostArch $NativeHostArch
[XML]$xml = Get-Content $PathTargets
$xml.Project.PropertyGroup.WindowsSDKVersion = $win10SDKVer
$xml.Project.PropertyGroup.AdditionalDependentLibs = 'onecore.lib;shlwapi.lib'
Expand Down Expand Up @@ -690,6 +690,11 @@ function Get-BuildToolPath

function Get-Windows10SDKVersion
{
param(
[Parameter(Mandatory = $true)]
[ValidateSet('x86', 'x64', 'arm64', 'arm')]
[string]$NativeHostArch
)
## Search for latest windows sdk available on the machine
$windowsSDKPath = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\Lib"
$minSDKVersion = [version]"10.0.17763.0"
Expand All @@ -702,7 +707,8 @@ function Get-Windows10SDKVersion
$versionsAvailable = $versionsAvailable | Sort-Object -Descending
foreach ($version in $versionsAvailable) {
$windowsSDKPath = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\bin\$version\x86\register_app.vbs"
if (test-path $windowsSDKPath) {
$windowsSDKArchPath = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\bin\$version\$NativeHostArch"
if ((Test-Path $windowsSDKPath) -and (Test-Path $windowsSDKArchPath)) {
return $version
}
}
Expand Down