Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
fix TargetArchitecture
Browse files Browse the repository at this point in the history
  • Loading branch information
wfurt committed Aug 6, 2022
1 parent c6bfad6 commit 1aba364
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
28 changes: 28 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
<Project>
<PropertyGroup Label="CalculateTargetOS">
<_hostOS>Linux</_hostOS>
<_hostOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">OSX</_hostOS>
<_hostOS Condition="$([MSBuild]::IsOSPlatform('FREEBSD'))">FreeBSD</_hostOS>
<_hostOS Condition="$([MSBuild]::IsOSPlatform('NETBSD'))">NetBSD</_hostOS>
<_hostOS Condition="$([MSBuild]::IsOSPlatform('ILLUMOS'))">illumos</_hostOS>
<_hostOS Condition="$([MSBuild]::IsOSPlatform('SOLARIS'))">Solaris</_hostOS>
<_hostOS Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">windows</_hostOS>
<HostOS>$(_hostOS)</HostOS>
<TargetOS Condition="'$(TargetOS)' == ''">$(_hostOS)</TargetOS>
</PropertyGroup>

<PropertyGroup Label="CalculateArch">
<_hostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</_hostArch>
<BuildArchitecture Condition="'$(BuildArchitecture)' == ''">$(_hostArch)</BuildArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'arm'">arm</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'armv6'">armv6</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'armel'">armel</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'arm64'">arm64</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'loongarch64'">loongarch64</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 's390x'">s390x</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'ppc64le'">ppc64le</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and ('$(TargetOS)' == 'Browser' or '$(RuntimeIdentifier)' == 'browser-wasm')">wasm</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetsMobile)' == 'true'">x64</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
<Platform Condition="'$(Platform)' == '' and '$(InferPlatformFromTargetArchitecture)' == 'true'">$(TargetArchitecture)</Platform>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/templates/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
- ${{ if eq(parameters.osGroup, 'Windows') }}:
- _signingArgs: -sign
/p:DotNetSignType=$(_SignType)
- _buildargs: -ci -c $(_BuildConfig) $(_testBuildArg) $(_signingArgs) $(_officialBuildArgs) /p:TargetPlatform=${{ parameters.archType }}
- _buildargs: -ci -c $(_BuildConfig) $(_testBuildArg) $(_signingArgs) $(_officialBuildArgs) /p:TargetArchitecture=${{ parameters.archType }}
- ${{ if eq(parameters.archType, 'arm64') }}:
- _buildScript: docker run --platform linux/arm64 --volume $BUILD_REPOSITORY_LOCALPATH:/msquic -t mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-arm64v8-20220803130954-bfcd90a bash -c "apt-get update && apt-get install -y wget curl && curl -L -o /tmp/pwsh.tgz https://github.com/PowerShell/PowerShell/releases/download/v7.2.5/powershell-7.2.5-linux-arm64.tar.gz && tar xfz /tmp/pwsh.tgz -C /usr/local/bin/ && curl -o /tmp/cmake.tgz https://cmake.org/files/v3.23/cmake-3.23.1-linux-aarch64.tar.gz && tar xfz /tmp/cmake.tgz -C /usr/local/bin/ && /msquic/build.sh $(_buildargs)" && echo
- _buildScript: docker run --platform linux/arm64 --volume $BUILD_REPOSITORY_LOCALPATH:/msquic -t mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-arm64v8-20220803130954-bfcd90a bash -c "apt-get update && apt-get install -y wget curl && curl -L -o /tmp/pwsh.tgz https://github.com/PowerShell/PowerShell/releases/download/v7.2.5/powershell-7.2.5-linux-arm64.tar.gz && tar xfz /tmp/pwsh.tgz -C /usr/local/bin/ && curl -o /tmp/cmake.tgz https://cmake.org/files/v3.23/cmake-3.23.1-linux-aarch64.tar.gz && tar xfz /tmp/cmake.tgz --strip 1 -C /usr/local/bin/ && /msquic/build.sh $(_buildargs)" && echo

steps:
- checkout: self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@

<Target Name="Build-native" AfterTargets="Build">
<Exec
Command="pwsh scripts/build.ps1 -Config Release -Arch x64 $(ExtraMsquicArgs) -UseSystemOpenSSLCrypto -DisableTools -DisableTest -DisablePerf"
WorkingDirectory="../msquic"/>
<Exec
Command="pwsh scripts/build.ps1 -Config Release -Arch x86 $(ExtraMsquicArgs) -UseSystemOpenSSLCrypto -DisableTools -DisableTest -DisablePerf"
Command="pwsh scripts/build.ps1 -Config Release -Arch $(TargetArchitecture) $(ExtraMsquicArgs) -UseSystemOpenSSLCrypto -DisableTools -DisableTest -DisablePerf"
WorkingDirectory="../msquic"/>
</Target>
</Project>

0 comments on commit 1aba364

Please sign in to comment.