forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codeOptimization.targets
30 lines (27 loc) · 1.66 KB
/
codeOptimization.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<Project>
<PropertyGroup Condition="'$(IsEligibleForNgenOptimization)' == ''">
<IsEligibleForNgenOptimization>true</IsEligibleForNgenOptimization>
<IsEligibleForNgenOptimization Condition="'$(IsReferenceAssembly)' == 'true'">false</IsEligibleForNgenOptimization>
<IsEligibleForNgenOptimization Condition="'$(GeneratePlatformNotSupportedAssembly)' == 'true' or '$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">false</IsEligibleForNgenOptimization>
<!-- There's an issue causing IBCMerge failures because of mismatched MVIDs
across many of our assemblies on Mac, so disable
IBCMerge optimizations on Mac for now to unblock the offical build.
See issue https://github.com/dotnet/runtime/issues/33303
-->
<IsEligibleForNgenOptimization Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true'">false</IsEligibleForNgenOptimization>
</PropertyGroup>
<Target Name="SetApplyNgenOptimization"
Condition="'$(IsEligibleForNgenOptimization)' == 'true'"
BeforeTargets="CoreCompile">
<PropertyGroup>
<IbcOptimizationDataDir Condition="'$(TargetOS)' == 'Unix' or '$(TargetOS)' == 'Linux'">$(IbcOptimizationDataDir)Linux\</IbcOptimizationDataDir>
<IbcOptimizationDataDir Condition="'$(TargetOS)' == 'windows'">$(IbcOptimizationDataDir)Windows\</IbcOptimizationDataDir>
</PropertyGroup>
<ItemGroup>
<_optimizationDataAssembly Include="$(IbcOptimizationDataDir)**\$(TargetFileName)" />
</ItemGroup>
<PropertyGroup>
<ApplyNgenOptimization Condition="'@(_optimizationDataAssembly)' != ''">full</ApplyNgenOptimization>
</PropertyGroup>
</Target>
</Project>