Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@
<IlcHostPackagePath Condition="'@(ResolvedILCompilerPack)' == '$(_hostPackageName)'">@(ResolvedILCompilerPack->'%(PackageDirectory)')</IlcHostPackagePath>
<RuntimePackagePath Condition="'@(ResolvedTargetILCompilerPack)' == ''">@(ResolvedILCompilerPack->'%(PackageDirectory)')</RuntimePackagePath>
<RuntimePackagePath Condition="'@(ResolvedTargetILCompilerPack)' != ''">@(ResolvedTargetILCompilerPack->'%(PackageDirectory)')</RuntimePackagePath>
<IlcUseNativeAOTRuntimePackLayout Condition="'@(ResolvedTargetILCompilerPack)' == '$(_targetRuntimePackName)'">true</IlcUseNativeAOTRuntimePackLayout>
<IlcUseNativeAOTRuntimePackLayout Condition="'$(IlcUseNativeAOTRuntimePackLayout)' == ''">$(PublishAotUsingRuntimePack)</IlcUseNativeAOTRuntimePackLayout>
</PropertyGroup>

</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
Text="Add a PackageReference for '$(_hostPackageName)' to allow cross-compilation for $(_targetArchitecture)" />

<!-- NativeAOT runtime pack assemblies need to be defined to avoid the default CoreCLR implementations being set as compiler inputs -->
<Error Condition="'@(PrivateSdkAssemblies)' == '' and '$(IlcUseNativeAOTRuntimePackLayout)' != 'true'" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
<Error Condition="'@(FrameworkAssemblies)' == '' and '$(IlcUseNativeAOTRuntimePackLayout)' != 'true'" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
<Error Condition="'@(PrivateSdkAssemblies)' == ''" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
<Error Condition="'@(FrameworkAssemblies)' == ''" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />

<ComputeManagedAssembliesToCompileToNative
Assemblies="@(_ResolvedCopyLocalPublishAssets)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<_NETCoreAppFrameworkReference Include="@(ResolvedFrameworkReference)" Condition="'%(ResolvedFrameworkReference.RuntimePackName)' == 'Microsoft.NETCore.App.Runtime.NativeAOT.$(RuntimeIdentifier)'" />
</ItemGroup>

<PropertyGroup Condition="'$(IlcUseNativeAOTRuntimePackLayout)' == 'true'">
<PropertyGroup>
<!--
If we're actually using the runtime pack from the ResolvedFrameworkReference, pull the path from there.
Otherwise pull it from the RuntimePackagePath.
Expand All @@ -144,37 +144,21 @@ The .NET Foundation licenses this file to you under the MIT license.
<IlcSdkPath Condition="'$(IlcSdkPath)' == ''">$(IlcFrameworkNativePath)</IlcSdkPath>
</PropertyGroup>

<PropertyGroup Condition="'$(IlcUseNativeAOTRuntimePackLayout)' != 'true'">
<IlcFrameworkPath Condition="'$(IlcFrameworkPath)' == ''">$(RuntimePackagePath)\framework\</IlcFrameworkPath>
<IlcFrameworkNativePath Condition="'$(IlcFrameworkNativePath)' == ''">$(RuntimePackagePath)\framework\</IlcFrameworkNativePath>
<IlcSdkPath Condition="'$(IlcSdkPath)' == ''">$(RuntimePackagePath)\sdk\</IlcSdkPath>
</PropertyGroup>

<PropertyGroup>
<!-- Define paths used in build targets to point to the runtime-specific ILCompiler implementation -->
<IlcToolsPath Condition="'$(IlcToolsPath)' == ''">$(IlcHostPackagePath)\tools\</IlcToolsPath>
<IlcMibcPath Condition="'$(IlcMibcPath)' == ''">$(RuntimePackagePath)\mibc\</IlcMibcPath>
</PropertyGroup>

<ItemGroup Condition="'$(IlcUseNativeAOTRuntimePackLayout)' == 'true'">
<ItemGroup>
<PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll"/>
<FrameworkAssemblies Include="@(RuntimePackAsset)" Condition="'$(PublishAotUsingRuntimePack)' == 'true' and '%(Extension)' == '.dll'" />
<!-- When we aren't pulling in runtime pack assets, make sure we manually grab the assets that the SDK would select from within the package. -->
<FrameworkAssemblies Include="$(IlcFrameworkPath)**/*.dll" Condition="'$(PublishAotUsingRuntimePack)' != 'true'" />
<FrameworkAssemblies Include="$(IlcFrameworkNativePath)*.dll" Exclude="$(IlcFrameworkNativePath)*.Native.dll;$(IlcFrameworkNativePath)msquic.dll" Condition="'$(PublishAotUsingRuntimePack)' != 'true'" />
<DefaultFrameworkAssemblies Include="@(FrameworkAssemblies)" />
<DefaultFrameworkAssemblies Include="@(PrivateSdkAssemblies)" Exclude="@(DefaultFrameworkAssemblies)" />
</ItemGroup>

<ItemGroup Condition="'$(IlcUseNativeAOTRuntimePackLayout)' != 'true'">
<PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll"/>
<!-- Exclude unmanaged dlls -->
<FrameworkAssemblies Include="$(IlcFrameworkPath)*.dll" Exclude="$(IlcFrameworkPath)*.Native.dll;$(IlcFrameworkPath)msquic.dll" />

<DefaultFrameworkAssemblies Include="@(PrivateSdkAssemblies)" />
<DefaultFrameworkAssemblies Include="@(FrameworkAssemblies)" />
</ItemGroup>

<ItemGroup>
<MibcFile Include="$(IlcMibcPath)*.mibc" Condition="'$(IlcPgoOptimize)' == 'true'" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,48 +29,13 @@
</ItemGroup>
</Target>

<Target Name="GetHostIlcCompilerFiles"
DependsOnTargets="ResolveLibrariesFromLocalBuild"
BeforeTargets="GetPackageFiles"
Condition="'$(PackHostILCompiler)' == 'true' and '$(PackageTargetRuntime)' != ''">

<ItemGroup>
<File Include="$(CoreCLRCrossILCompilerDir)*" TargetPath="tools" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'linux'">
<File Include="$(SharedNativeRoot)libs\System.Globalization.Native\*" TargetPath="native/src/libs/System.Globalization.Native"/>
<File Include="$(SharedNativeRoot)libs\System.Security.Cryptography.Native\*" TargetPath="native/src/libs/System.Security.Cryptography.Native"/>
<File Include="$(SharedNativeRoot)libs\build-local.sh" TargetPath="native/src/libs/build-local.sh"/>
<File Include="$(SharedNativeRoot)minipal\*" TargetPath="native/src/minipal"/>
<File Include="$(SharedNativeRoot)libs\Common\*" TargetPath="native/src/libs/Common"/>
</ItemGroup>

<!-- exclude native symbols from ilc package (they are included in symbols package) -->
<ItemGroup>
<!-- on windows, remove the pdbs only from tools directory (both managed and native) -->
<LibPackageExcludes Include="tools\%2A%2A\%2A.pdb"/>

<LibPackageExcludes Include="%2A%2A\%2A.dbg"/>
<LibPackageExcludes Include="%2A%2A\%2A.debug"/>
<LibPackageExcludes Include="%2A%2A\%2A.dSYM"/>
<LibPackageExcludes Include="%2A%2A\%2A.dwarf"/>
</ItemGroup>

</Target>

<Target Name="GetIlcCompilerFiles"
DependsOnTargets="ResolveLibrariesFromLocalBuild"
BeforeTargets="GetPackageFiles"
Condition="'$(PackHostILCompiler)' != 'true' and '$(PackageTargetRuntime)' != ''">
Condition="'$(PackageTargetRuntime)' != ''">

<ItemGroup>
<!-- Include all libraries (managed, static, etc.), but exclude native shared libraries (those with LibSuffix) -->
<File Include="@(LibrariesRuntimeFiles)" TargetPath="framework" Condition="'%(LibrariesRuntimeFiles.IsNative)' != 'true' or '%(LibrariesRuntimeFiles.Extension)' != '$(LibSuffix)'" />

<File Include="$(CoreCLRILCompilerDir)*" TargetPath="tools" />
<File Include="$(CoreCLRAotSdkDir)*" TargetPath="sdk" />
<File Include="$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/**/*.mibc" TargetPath="mibc" />
<File Include="$(CoreCLRCrossILCompilerDir)*" TargetPath="tools" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'linux'">
Expand All @@ -93,5 +58,4 @@
</ItemGroup>

</Target>

</Project>
2 changes: 1 addition & 1 deletion src/installer/pkg/projects/nativeaot-packages.proj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Project Include="Microsoft.DotNet.ILCompiler\Microsoft.DotNet.ILCompiler.pkgproj" />
<ProjectReference Include="@(Project)" />
<ProjectReference Include="@(Project)" AdditionalProperties="PackageTargetRuntime=$(TargetRid)" />
<ProjectReference Condition="'$(BuildHostTools)' == 'true'" Include="@(Project)" AdditionalProperties="PackageTargetRuntime=$(NETCoreSdkRuntimeIdentifier);PackHostILCompiler=true" />
<ProjectReference Condition="'$(BuildHostTools)' == 'true'" Include="@(Project)" AdditionalProperties="PackageTargetRuntime=$(NETCoreSdkRuntimeIdentifier)" />
</ItemGroup>

<Import Sdk="Microsoft.Build.Traversal" Project="Sdk.targets" />
Expand Down
Loading