|
4 | 4 | steps and in the repository.
|
5 | 5 | -->
|
6 | 6 |
|
| 7 | + <PropertyGroup> |
| 8 | + <!-- Default to portable build if not explicitly set --> |
| 9 | + <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild> |
| 10 | + </PropertyGroup> |
| 11 | + |
7 | 12 | <PropertyGroup>
|
8 | 13 | <LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
|
9 | 14 | <CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
|
|
49 | 54 | </PropertyGroup>
|
50 | 55 |
|
51 | 56 | <PropertyGroup>
|
52 |
| - <HostRuntimeIdentifier Condition="'$(HostRuntimeIdentifier)' == '' and '$(MSBuildRuntimeType)' == 'core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</HostRuntimeIdentifier> |
53 |
| - <HostRuntimeIdentifier Condition="'$(HostRuntimeIdentifier)' == '' and '$(MSBuildRuntimeType)' != 'core'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</HostRuntimeIdentifier> |
54 |
| - |
55 | 57 | <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('OSX'))">OSX</TargetOS>
|
56 | 58 | <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('FREEBSD'))">FreeBSD</TargetOS>
|
57 | 59 | <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('NETBSD'))">NetBSD</TargetOS>
|
|
68 | 70 | <TargetsMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'Browser'">true</TargetsMobile>
|
69 | 71 | </PropertyGroup>
|
70 | 72 |
|
| 73 | + <PropertyGroup Label="CalculateOS"> |
| 74 | + <_runtimeOS>$(RuntimeOS)</_runtimeOS> |
| 75 | + |
| 76 | + <_parseDistroRid>$(__DistroRid)</_parseDistroRid> |
| 77 | + <_parseDistroRid Condition="'$(_parseDistroRid)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</_parseDistroRid> |
| 78 | + <_distroRidIndex>$(_parseDistroRid.LastIndexOfAny("-"))</_distroRidIndex> |
| 79 | + |
| 80 | + <_runtimeOS Condition="'$(_runtimeOS)' == ''">$(_parseDistroRid.SubString(0, $(_distroRidIndex)))</_runtimeOS> |
| 81 | + |
| 82 | + <!-- _runtimeOS is calculated based on the build system OS, however if building for Browser/iOS/Android we need to let |
| 83 | + the build system to use browser/ios/android as the _runtimeOS for produced package RIDs. --> |
| 84 | + <_runtimeOS Condition="'$(TargetsMobile)' == 'true'">$(TargetOS.ToLowerInvariant())</_runtimeOS> |
| 85 | + |
| 86 | + <_runtimeOSVersionIndex>$(_runtimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex> |
| 87 | + <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(_runtimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily> |
| 88 | + |
| 89 | + <_buildingInOSX>$([MSBuild]::IsOSPlatform('OSX'))</_buildingInOSX> |
| 90 | + <_portableOS>linux</_portableOS> |
| 91 | + <_portableOS Condition="'$(_runtimeOS)' == 'linux-musl'">linux-musl</_portableOS> |
| 92 | + <_portableOS Condition="$(_buildingInOSX)">osx</_portableOS> |
| 93 | + <_portableOS Condition="'$(_runtimeOSFamily)' == 'win' or '$(TargetOS)' == 'windows'">win</_portableOS> |
| 94 | + <_portableOS Condition="'$(_runtimeOSFamily)' == 'FreeBSD'">freebsd</_portableOS> |
| 95 | + <_portableOS Condition="'$(_runtimeOSFamily)' == 'illumos'">illumos</_portableOS> |
| 96 | + <_portableOS Condition="'$(_runtimeOSFamily)' == 'Solaris'">solaris</_portableOS> |
| 97 | + <_portableOS Condition="'$(_runtimeOS)' == 'Browser'">browser</_portableOS> |
| 98 | + <_portableOS Condition="'$(_runtimeOS)' == 'ios'">ios</_portableOS> |
| 99 | + <_portableOS Condition="'$(_runtimeOS)' == 'tvos'">tvos</_portableOS> |
| 100 | + <_portableOS Condition="'$(_runtimeOS)' == 'android'">android</_portableOS> |
| 101 | + |
| 102 | + <_runtimeOS Condition="$(_runtimeOS.StartsWith('tizen'))">linux</_runtimeOS> |
| 103 | + <_runtimeOS Condition="'$(PortableBuild)' == 'true'">$(_portableOS)</_runtimeOS> |
| 104 | + |
| 105 | + <!-- support cross-targeting by choosing a RID to restore when running on a different machine that what we're build for --> |
| 106 | + <_portableOS Condition="'$(TargetOS)' == 'Unix' and '$(_runtimeOSFamily)' != 'osx' and '$(_runtimeOSFamily)' != 'FreeBSD' and '$(_runtimeOS)' != 'linux-musl' and '$(_runtimeOSFamily)' != 'illumos' and '$(_runtimeOSFamily)' != 'Solaris'">linux</_portableOS> |
| 107 | + </PropertyGroup> |
| 108 | + |
| 109 | + <PropertyGroup Label="CalculateArch"> |
| 110 | + <_hostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</_hostArch> |
| 111 | + <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'arm'">arm</TargetArchitecture> |
| 112 | + <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'arm64'">arm64</TargetArchitecture> |
| 113 | + <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetOS)' == 'Browser'">wasm</TargetArchitecture> |
| 114 | + <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetsMobile)' == 'true'">x64</TargetArchitecture> |
| 115 | + <TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture> |
| 116 | + </PropertyGroup> |
| 117 | + |
| 118 | + <PropertyGroup Label="CalculateRID"> |
| 119 | + <_toolRuntimeRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64</_toolRuntimeRID> |
| 120 | + <_toolRuntimeRID Condition="'$(_toolRuntimeRID)' == ''">$(_runtimeOS)-$(_hostArch)</_toolRuntimeRID> |
| 121 | + <!-- We build linux-musl-arm on a ubuntu container, so we can't use the toolset build for alpine runtime. We need to use portable linux RID for our toolset in order to be able to use it. --> |
| 122 | + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'linux-musl' and $(TargetArchitecture.StartsWith('arm')) and !$(_hostArch.StartsWith('arm'))">linux-x64</_toolRuntimeRID> |
| 123 | + |
| 124 | + <!-- There are no WebAssembly tools, so use the default ones --> |
| 125 | + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(TargetOS)' == 'windows'">win-x64</_toolRuntimeRID> |
| 126 | + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(TargetOS)' != 'windows' and $(_buildingInOSX)">osx-x64</_toolRuntimeRID> |
| 127 | + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(TargetOS)' != 'windows' and !$(_buildingInOSX)">linux-x64</_toolRuntimeRID> |
| 128 | + |
| 129 | + <!-- There are no Android tools, so use the default ones --> |
| 130 | + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(TargetOS)' == 'windows'">win-x64</_toolRuntimeRID> |
| 131 | + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(TargetOS)' != 'windows' and $(_buildingInOSX)">osx-x64</_toolRuntimeRID> |
| 132 | + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(TargetOS)' != 'windows' and !$(_buildingInOSX)">linux-x64</_toolRuntimeRID> |
| 133 | + |
| 134 | + <!-- There are no iOS or tvOS tools and it can be built on OSX only, so use that --> |
| 135 | + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'tvos'">osx-x64</_toolRuntimeRID> |
| 136 | + <MicrosoftNetCoreIlasmPackageRuntimeId>$(_toolRuntimeRID)</MicrosoftNetCoreIlasmPackageRuntimeId> |
| 137 | + |
| 138 | + <_packageRID Condition="'$(PortableBuild)' == 'true'">$(_portableOS)-$(TargetArchitecture)</_packageRID> |
| 139 | + <PackageRID Condition="'$(PackageRID)' == ''">$(_packageRID)</PackageRID> |
| 140 | + <PackageRID Condition="'$(PackageRID)' == ''">$(_runtimeOS)-$(TargetArchitecture)</PackageRID> |
| 141 | + |
| 142 | + <_outputRID Condition="'$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</_outputRID> |
| 143 | + <_outputRID Condition="'$(TargetOS)' == 'OSX'">osx-$(TargetArchitecture)</_outputRID> |
| 144 | + <_outputRID Condition="'$(TargetOS)' == 'Linux'">linux-$(TargetArchitecture)</_outputRID> |
| 145 | + <_outputRID Condition="'$(TargetOS)' == 'FreeBSD'">freebsd-$(TargetArchitecture)</_outputRID> |
| 146 | + <_outputRID Condition="'$(TargetOS)' == 'NetBSD'">netbsd-$(TargetArchitecture)</_outputRID> |
| 147 | + <_outputRID Condition="'$(TargetOS)' == 'illumos'">illumos-$(TargetArchitecture)</_outputRID> |
| 148 | + <_outputRID Condition="'$(TargetOS)' == 'Solaris'">solaris-$(TargetArchitecture)</_outputRID> |
| 149 | + <_outputRID Condition="'$(TargetOS)' == 'iOS'">ios-$(TargetArchitecture)</_outputRID> |
| 150 | + <_outputRID Condition="'$(TargetOS)' == 'tvOS'">tvos-$(TargetArchitecture)</_outputRID> |
| 151 | + <_outputRID Condition="'$(TargetOS)' == 'Android'">android-$(TargetArchitecture)</_outputRID> |
| 152 | + <_outputRID Condition="'$(TargetOS)' == 'Browser'">browser-$(TargetArchitecture)</_outputRID> |
| 153 | + |
| 154 | + <OutputRid Condition="'$(OutputRid)' == ''">$(PackageRID)</OutputRid> |
| 155 | + <OutputRid Condition="'$(PortableBuild)' == 'true'">$(_outputRID)</OutputRid> |
| 156 | + </PropertyGroup> |
| 157 | + |
| 158 | + <PropertyGroup Label="CalculateTargetOSName" Condition="'$(SkipInferTargetOSName)' != 'true'"> |
| 159 | + <TargetsFreeBSD Condition="'$(TargetOS)' == 'FreeBSD'">true</TargetsFreeBSD> |
| 160 | + <Targetsillumos Condition="'$(TargetOS)' == 'illumos'">true</Targetsillumos> |
| 161 | + <TargetsSolaris Condition="'$(TargetOS)' == 'Solaris'">true</TargetsSolaris> |
| 162 | + <TargetsLinux Condition="'$(TargetOS)' == 'Linux' or '$(TargetOS)' == 'Android'">true</TargetsLinux> |
| 163 | + <TargetsNetBSD Condition="'$(TargetOS)' == 'NetBSD'">true</TargetsNetBSD> |
| 164 | + <TargetsOSX Condition="'$(TargetOS)' == 'OSX'">true</TargetsOSX> |
| 165 | + <TargetsiOS Condition="'$(TargetOS)' == 'iOS'">true</TargetsiOS> |
| 166 | + <TargetstvOS Condition="'$(TargetOS)' == 'tvOS'">true</TargetstvOS> |
| 167 | + <TargetsiOSSimulator Condition="'$(TargetsiOS)' == 'true' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86')">true</TargetsiOSSimulator> |
| 168 | + <TargetstvOSSimulator Condition="'$(TargetstvOS)' == 'true' and '$(TargetArchitecture)' == 'x64'">true</TargetstvOSSimulator> |
| 169 | + <TargetsAndroid Condition="'$(TargetOS)' == 'Android'">true</TargetsAndroid> |
| 170 | + <TargetsBrowser Condition="'$(TargetOS)' == 'Browser'">true</TargetsBrowser> |
| 171 | + <TargetsWindows Condition="'$(TargetOS)' == 'windows'">true</TargetsWindows> |
| 172 | + <TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(Targetsillumos)' == 'true' or '$(TargetsSolaris)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true'">true</TargetsUnix> |
| 173 | + </PropertyGroup> |
| 174 | + |
71 | 175 | <!--Feature switches -->
|
72 | 176 | <PropertyGroup>
|
73 | 177 | <EnableNgenOptimization Condition="'$(EnableNgenOptimization)' == '' and '$(Configuration)' == 'Release'">true</EnableNgenOptimization>
|
|
76 | 180 | <!-- Turn off end of life target framework checks as we intentionally build older .NETCoreApp configurations. -->
|
77 | 181 | <CheckEolTargetFramework>false</CheckEolTargetFramework>
|
78 | 182 | </PropertyGroup>
|
| 183 | + |
| 184 | + <Import Project="$(MSBuildThisFileDirectory)native\naming.props" /> |
79 | 185 | </Project>
|
0 commit comments