-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Centralize all performance-related properties
- Loading branch information
1 parent
92d651e
commit ebfecc4
Showing
5 changed files
with
79 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<Project> | ||
|
||
<!-- | ||
Additional global options for all projects targeting Windows in their TFMs. | ||
We actually set these in a .props file and without checking the framework, as: | ||
- Setting these properties in non-Windows projects will just not do anything. | ||
- Setting these from the shared .targets causes them to be imported too late. | ||
They'd need to be added to "CustomBeforeMicrosoftCommonTargets" file, but the | ||
complexity of having to set that up and validate it is just not worth it, as | ||
we can just unconditionally set these and worst case, they'll be no-ops. | ||
--> | ||
<PropertyGroup> | ||
|
||
<!-- | ||
Enable the CsWinRT trim/AOT analyzer for scenarios involving all types (including built-in types). | ||
The .NET SDK sets this to '1' (which excludes built-in types) by default to reduce false positives. | ||
--> | ||
<CsWinRTAotWarningLevel>2</CsWinRTAotWarningLevel> | ||
|
||
<!-- | ||
We're only referencing CsWinRT for the source generators, we don't need to read any WinRT metadata. | ||
CsWinRT is in projection mode by default, so we want to disable it (or it'd need the Windows SDK). | ||
--> | ||
<CsWinRTGenerateProjection>false</CsWinRTGenerateProjection> | ||
|
||
<!-- We'll never have any IIDs to patch in any projects in the solution --> | ||
<CsWinRTIIDOptimizerOptOut>true</CsWinRTIIDOptimizerOptOut> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<Project> | ||
|
||
<!-- Properties exclusive to all .NET 8 projects (not just published projects) --> | ||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> | ||
|
||
<!-- Emit the [DisableRuntimeMarshalling] attribute (also enables the associated analyzer) --> | ||
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
The following target has been ported from TerraFX.Interop.Windows. | ||
See: https://github.com/terrafx/terrafx.interop.windows. | ||
This generates the [module: SkipLocalsInit] attribute for all projects. | ||
--> | ||
<PropertyGroup> | ||
<GeneratedSkipLocalsInitFile Condition="'$(GeneratedSkipLocalsInitFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).SkipLocalsInit.g.cs</GeneratedSkipLocalsInitFile> | ||
<GeneratedSkipLocalsInitFileLines> | ||
<![CDATA[//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
[module: System.Runtime.CompilerServices.SkipLocalsInitAttribute]]]> | ||
</GeneratedSkipLocalsInitFileLines> | ||
</PropertyGroup> | ||
|
||
<Target Name="GenerateSkipLocalsInit" | ||
BeforeTargets="BeforeCompile;CoreCompile" | ||
DependsOnTargets="PrepareForBuild" | ||
Condition="'$(Language)' == 'C#'" | ||
Inputs="$(MSBuildAllProjects)" | ||
Outputs="$(GeneratedSkipLocalsInitFile)"> | ||
|
||
<!-- Write the file with the attribute --> | ||
<WriteLinesToFile Lines="$(GeneratedSkipLocalsInitFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" File="$(GeneratedSkipLocalsInitFile)" /> | ||
|
||
<!-- Include the generated file in the list of files to compile --> | ||
<ItemGroup> | ||
<Compile Include="$(GeneratedSkipLocalsInitFile)" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters