Skip to content

Commit 8479358

Browse files
committed
Separate CanExecute and Supported concerns
1 parent 36c82a8 commit 8479358

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

eng/Subsets.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
<!-- CLR NativeAot only builds in a subset of the matrix -->
122122
<_NativeAotSupportedOS Condition="'$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'freebsd'">true</_NativeAotSupportedOS>
123123
<_NativeAotSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86')">true</_NativeAotSupportedArch>
124-
<_NativeAotSupportedCrossOS Condition="'$(CrossBuild)' != 'true' or '$(TargetOS)' == '$(HostOS)' or '$(TargetsLinuxBionic)' == 'true' or '$(TargetsAppleMobile)' == 'true'">true</_NativeAotSupportedCrossOS>
125-
<NativeAotSupported Condition="'$(_NativeAotSupportedOS)' == 'true' and '$(_NativeAotSupportedArch)' == 'true' and '$(_NativeAotSupportedCrossOS)' == 'true'">true</NativeAotSupported>
124+
<NativeAotSupported Condition="'$(_NativeAotSupportedOS)' == 'true' and '$(_NativeAotSupportedArch)' == 'true'">true</NativeAotSupported>
125+
<NativeAotCanExecuteOnHost Condition="'$(NativeAotSupported)' == 'true' and ('$(CrossBuild)' != 'true' or '$(TargetOS)' == '$(HostOS)')">true</NativeAotCanExecuteOnHost>
126126

127127
<!-- If we're building clr.nativeaotlibs and not building the CLR runtime, compile libraries against NativeAOT CoreLib -->
128128
<UseNativeAotCoreLib Condition="'$(TestNativeAot)' == 'true' or ($(_subset.Contains('+clr.nativeaotlibs+')) and !$(_subset.Contains('+clr.native+')) and !$(_subset.Contains('+clr.runtime+')) and !$(_subset.Contains('+clr.corelib+')))">true</UseNativeAotCoreLib>

src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
1212
<PublishDir>$(RuntimeBinDir)ilc-published/</PublishDir>
1313
<!-- block win-x86 PublishAot until preview 5 -->
14-
<NativeAotSupported Condition="$(OutputRID.EndsWith('-x86')) == 'true'">false</NativeAotSupported>
15-
<PublishAot Condition="'$(NativeAotSupported)' == 'true'">true</PublishAot>
16-
<SysRoot Condition="'$(NativeAotSupported)' == 'true' and '$(CrossBuild)' == 'true' and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>
17-
<PublishReadyToRun Condition="'$(NativeAotSupported)' != 'true'">true</PublishReadyToRun>
18-
<PublishSingleFile Condition="'$(NativeAotSupported)' != 'true'">true</PublishSingleFile>
19-
<PublishTrimmed Condition="'$(NativeAotSupported)' != 'true'">true</PublishTrimmed>
14+
<NativeAotCanExecuteOnHost Condition="'$(NativeAotCanExecuteOnHost)' == 'true' and $(OutputRID.EndsWith('-x86')) == 'true'">false</NativeAotCanExecuteOnHost>
15+
<PublishAot Condition="'$(NativeAotCanExecuteOnHost)' == 'true'">true</PublishAot>
16+
<SysRoot Condition="'$(NativeAotCanExecuteOnHost)' == 'true' and '$(CrossBuild)' == 'true' and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>
17+
<PublishReadyToRun Condition="'$(NativeAotCanExecuteOnHost)' != 'true'">true</PublishReadyToRun>
18+
<PublishSingleFile Condition="'$(NativeAotCanExecuteOnHost)' != 'true'">true</PublishSingleFile>
19+
<PublishTrimmed Condition="'$(NativeAotCanExecuteOnHost)' != 'true'">true</PublishTrimmed>
2020
<SuppressGenerateILCompilerExplicitPackageReferenceWarning>true</SuppressGenerateILCompilerExplicitPackageReferenceWarning>
2121
<!-- Can be removed (along with RuntimeHostConfigurationOption below)
2222
once we build with a more recent SDK that has https://github.com/dotnet/sdk/pull/40106. -->
2323
<_ComObjectDescriptorSupport>false</_ComObjectDescriptorSupport>
2424
</PropertyGroup>
2525

26-
<ItemGroup Condition="'$(NativeAotSupported)' == 'true'">
26+
<ItemGroup Condition="'$(NativeAotCanExecuteOnHost)' == 'true'">
2727
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="$(MicrosoftDotNetILCompilerVersion)" />
2828
<PackageReference Include="runtime.$(ToolsRID).Microsoft.DotNet.ILCompiler" Version="$(MicrosoftDotNetILCompilerVersion)" />
2929
<RuntimeHostConfigurationOption Include="System.ComponentModel.TypeDescriptor.IsComObjectDescriptorSupported"
@@ -57,7 +57,7 @@
5757
</Target>
5858

5959
<Target Name="LocateNativeCompiler"
60-
Condition="'$(NativeAotSupported)' == 'true' and '$(HostOS)' != 'windows'"
60+
Condition="'$(NativeAotCanExecuteOnHost)' == 'true' and '$(HostOS)' != 'windows'"
6161
BeforeTargets="SetupOSSpecificProps">
6262
<PropertyGroup>
6363
<CppCompilerAndLinker Condition="'$(CppCompilerAndLinker)' == ''">clang</CppCompilerAndLinker>
@@ -79,7 +79,7 @@
7979
<_XcodeVersion>$([System.Text.RegularExpressions.Regex]::Match($(_XcodeVersionString), '[1-9]\d*'))</_XcodeVersion>
8080
</PropertyGroup>
8181

82-
<ItemGroup Condition="'$(NativeAotSupported)' == 'true' and '$(_IsApplePlatform)' == 'true'">
82+
<ItemGroup Condition="'$(NativeAotCanExecuteOnHost)' == 'true' and '$(_IsApplePlatform)' == 'true'">
8383
<CustomLinkerArg Condition="'$(_XcodeVersion)' &gt;= '15'" Include="-ld_classic" />
8484
</ItemGroup>
8585

@@ -90,7 +90,7 @@
9090
</PropertyGroup>
9191
</Target>
9292

93-
<ItemGroup Condition="'$(NativeAotSupported)' == 'true'">
93+
<ItemGroup Condition="'$(NativeAotCanExecuteOnHost)' == 'true'">
9494
<CustomLinkerArg Condition="'$(CrossBuild)' == 'true' and '$(BuildArchitecture)' == '$(_targetArchitecture)' and '$(HostOS)' != 'windows' and '$(_IsApplePlatform)' != 'true'" Include="--gcc-toolchain=$(ROOTFS_DIR)/usr" />
9595
</ItemGroup>
9696

src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<PropertyGroup>
2121
<!-- block win-x86 PublishAot until preview 5 -->
22-
<NativeAotSupported Condition="$(OutputRID.EndsWith('-x86')) == 'true'">false</NativeAotSupported>
22+
<NativeAotCanExecuteOnHost Condition="'$(NativeAotCanExecuteOnHost)' == 'true' and $(OutputRID.EndsWith('-x86')) == 'true'">false</NativeAotCanExecuteOnHost>
2323
<PublishTrimmed>true</PublishTrimmed>
2424
<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
2525
<SelfContained>true</SelfContained>
@@ -29,7 +29,7 @@
2929

3030
<Import Project="crossgen2.props" />
3131

32-
<PropertyGroup Condition="'$(NativeAotSupported)' != 'true'">
32+
<PropertyGroup Condition="'$(NativeAotCanExecuteOnHost)' != 'true'">
3333
<PublishSingleFile>true</PublishSingleFile>
3434
<PublishReadyToRun>true</PublishReadyToRun>
3535
<!-- Disable crossgen on NetBSD, illumos, Solaris, and Haiku for now. This can be revisited when we have full support. -->
@@ -49,7 +49,7 @@
4949
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />
5050
<Import Project="$(RepositoryEngineeringDir)codeOptimization.targets" />
5151

52-
<PropertyGroup Condition="'$(NativeAotSupported)' == 'true'">
52+
<PropertyGroup Condition="'$(NativeAotCanExecuteOnHost)' == 'true'">
5353
<IlcToolsPath>$(CoreCLRILCompilerDir)</IlcToolsPath>
5454
<IlcToolsPath Condition="'$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)' or '$(EnableNativeSanitizers)' != ''">$(CoreCLRCrossILCompilerDir)</IlcToolsPath>
5555
<SysRoot Condition="('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)') and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>
@@ -63,12 +63,12 @@
6363
<DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions>
6464
</PropertyGroup>
6565

66-
<ItemGroup Condition="'$(NativeAotSupported)' == 'true'">
66+
<ItemGroup Condition="'$(NativeAotCanExecuteOnHost)' == 'true'">
6767
<CustomLinkerArg Condition="'$(CrossBuild)' == 'true' and '$(_hostArchitecture)' == '$(_targetArchitecture)' and '$(_IsApplePlatform)' != 'true' and '$(_hostOS)' != 'windows'" Include="--gcc-toolchain=$(ROOTFS_DIR)/usr" />
6868
</ItemGroup>
6969

7070
<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.SingleEntry.targets"
71-
Condition="'$(NativeAotSupported)' == 'true'" />
71+
Condition="'$(NativeAotCanExecuteOnHost)' == 'true'" />
7272
<Import Project="$(RepositoryEngineeringDir)nativeSanitizers.targets" />
7373

7474
<!-- Needed for the amd64 -> amd64 musl cross-build to pass the target flag. -->
@@ -96,7 +96,7 @@
9696
</Target>
9797

9898
<Target Name="LocateNativeCompiler"
99-
Condition="'$(NativeAotSupported)' == 'true' and '$(HostOS)' != 'windows'"
99+
Condition="'$(NativeAotCanExecuteOnHost)' == 'true' and '$(HostOS)' != 'windows'"
100100
BeforeTargets="SetupOSSpecificProps">
101101
<PropertyGroup>
102102
<CppCompilerAndLinker Condition="'$(CppCompilerAndLinker)' == ''">clang</CppCompilerAndLinker>

0 commit comments

Comments
 (0)