summaryrefslogtreecommitdiff
path: root/src/build.proj
blob: f3f4dc630e1df9e59621a7ec5048e036d83b0d69 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<Project Sdk="Microsoft.Build.Traversal">

  <!-- List the projects that need to be restored only -->
 <ItemGroup Condition="'$(IncludeRestoreOnlyProjects)' == 'true'">
    <ProjectReference Condition="'$(BuildType)'=='Release'" Include="$(SourceDir).nuget/optdata/optdata.csproj" />
 </ItemGroup>

  <!-- List the projects that need to be built -->
  <ItemGroup>
    <ProjectReference Condition="'$(BuildManagedTools)' == 'true'" Include="tools/runincontext/runincontext.csproj" />
    <ProjectReference Condition="'$(BuildManagedTools)' == 'true'" Include="tools/r2rdump/R2RDump.csproj" />
    <ProjectReference Include="System.Private.CoreLib\System.Private.CoreLib.csproj" />
  </ItemGroup>

  <!-- [ARCADE_REMOVE] The below targets should be removed entirely when all projects become SDK
       projects. These should not be in this project file, but in a separate targets file for post-build.
  -->
  <Import Project="../dir.props" />

  <!-- Copy the UCRT files from the windows kit directory to the local directory.
       The api-*xstate.dll binary needs to be signed. -->
  <Target Name="CopyUcrtFiles" AfterTargets="Build">
    <ItemGroup>
      <UcrtFilesToCopy Include="$(UniversalCRTSDKDir)Redist\ucrt\DLLs\$(BuildArch)\*.dll" />
    </ItemGroup>

    <Copy Condition="'$(BuildType)'=='Release' AND '$(BuildArch)' != 'arm64'"
        SourceFiles="@(UcrtFilesToCopy)"
        DestinationFolder="$(BinDir)Redist\ucrt\DLLs\$(BuildArch)" />
  </Target>

  <PropertyGroup>
    <RunEnforcePGO Condition="$(__EnforcePgo) == '1'">true</RunEnforcePGO>
    <RunEnforcePGO Condition="$(BuildArch) == 'arm' OR $(BuildArch) == 'arm64'">false</RunEnforcePGO>
  </PropertyGroup>

  <Target Name="EnforcePGO" Condition="$(RunEnforcePGO) == 'true'" AfterTargets="Build">
    <ItemGroup>
      <PGOEnforcedFiles Include="$(BinDir)coreclr.dll" />
      <PGOEnforcedFiles Include="$(BinDir)clrjit.dll" />
    </ItemGroup>

    <Message Text="Checking if the following DLLs are properly compiled with PGO" Importance="High" />
    <Exec Command="&quot;$(PYTHON)&quot; $(MSBuildThisFileDirectory)scripts\pgocheck.py @(PGOEnforcedFiles)" />
  </Target>
</Project>