* Restores IBC data for both Linux and Windows on all platforms
* Chooses the right IBC data based on the target OS
* When target OS isn't anything specific (like, e.g. System.Linq and other assemblies that are not OS specific), embeds Windows IBC data
Commit migrated from https://github.com/dotnet/corefx/commit/
ef2ee1291ea6140cb462ead8b4cc86a762b58f64
<Target Name="SetApplyNgenOptimization"
Condition="'$(IsEligibleForNgenOptimization)' == 'true'"
BeforeTargets="CoreCompile">
+ <PropertyGroup>
+ <IbcOptimizationDataDir Condition="'$(OSGroup)' == 'Unix' or '$(OSGroup)' == 'Linux'">$(IbcOptimizationDataDir)$(LinuxCoreFxOptimizationDataPackageId)\</IbcOptimizationDataDir>
+ <IbcOptimizationDataDir Condition="'$(OSGroup)' != 'Unix' and '$(OSGroup)' != 'Linux'">$(IbcOptimizationDataDir)$(WindowsCoreFxOptimizationDataPackageId)\</IbcOptimizationDataDir>
+ </PropertyGroup>
<ItemGroup>
<_optimizationDataAssembly Include="$(IbcOptimizationDataDir)**\$(TargetFileName)" />
</ItemGroup>
</PropertyGroup>
</Target>
-</Project>
\ No newline at end of file
+</Project>
<!-- Copy to IBC directory -->
<OutputPath>$(IbcOptimizationDataDir)</OutputPath>
<EnableBinPlacing>false</EnableBinPlacing>
-
- <CoreFxOptimizationDataPackageId>optimization.windows_nt-x64.IBC.CoreFx</CoreFxOptimizationDataPackageId>
- <CoreFxOptimizationDataPackageId Condition="'$(IBCTarget)'=='Linux'">optimization.linux-x64.IBC.CoreFx</CoreFxOptimizationDataPackageId>
- <CoreFxOptimizationDataVersion>$(optimizationwindows_ntx64IBCCoreFxPackageVersion)</CoreFxOptimizationDataVersion>
</PropertyGroup>
<ItemGroup>
<!-- IBC data -->
- <IBCPackage Include="$(CoreFxOptimizationDataPackageId)" Version="$(CoreFxOptimizationDataVersion)" />
+ <IBCPackage Include="$(WindowsCoreFxOptimizationDataPackageId)" Version="$(WindowsCoreFxOptimizationDataVersion)" />
+ <IBCPackage Include="$(LinuxCoreFxOptimizationDataPackageId)" Version="$(LinuxCoreFxOptimizationDataVersion)" />
<PackageReference Include="@(IBCPackage)" GeneratePathProperty="true" />
</ItemGroup>