Make corelib crossgen incremental (#48086)
authorSven Boemer <sbomer@gmail.com>
Wed, 10 Feb 2021 01:35:04 +0000 (17:35 -0800)
committerGitHub <noreply@github.com>
Wed, 10 Feb 2021 01:35:04 +0000 (17:35 -0800)
* Make corelib crossgen incremental

* Fix typo

src/coreclr/crossgen-corelib.proj

index 61c31d7..a065b95 100644 (file)
@@ -4,8 +4,7 @@
     <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
   </PropertyGroup>
 
-  <Target Name="InvokeCrossgen"
-          AfterTargets="Build">
+  <Target Name="PrepareForCrossgen">
     <PropertyGroup>
       <!-- Default for using Crossgen2 when not set externally -->
       <UseCrossgen2 Condition="'$(UseCrossgen2)' == ''">true</UseCrossgen2>
       <ExeExtension Condition="'$(OS)' == 'Windows_NT'">.exe</ExeExtension>
       <DotNetCli>$([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.sh'))</DotNetCli>
       <DotNetCli Condition="'$(OS)' == 'Windows_NT'">$([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.cmd'))</DotNetCli>
-
-      <CoreLibAssemblyName>System.Private.CoreLib</CoreLibAssemblyName>
-      <CoreLibInputPath>$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '$(CoreLibAssemblyName).dll'))</CoreLibInputPath>
-      <CoreLibOutputPath>$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).dll'))</CoreLibOutputPath>
     </PropertyGroup>
 
     <PropertyGroup>
 
       <BuildPerfMap>false</BuildPerfMap>
       <BuildPerfMap Condition="$(BuildDll) and '$(TargetOS)' == 'Linux'">true</BuildPerfMap>
+    </PropertyGroup>
+
+    <PropertyGroup>
+      <CoreLibAssemblyName>System.Private.CoreLib</CoreLibAssemblyName>
+      <CoreLibInputPath>$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '$(CoreLibAssemblyName).dll'))</CoreLibInputPath>
+      <CoreLibOutputPath>$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).dll'))</CoreLibOutputPath>
+      <CoreLibNiPdbPath></CoreLibNiPdbPath>
+      <CoreLibPerfMapPath></CoreLibPerfMapPath>
+      <CoreLibNiPdbPath Condition="$(BuildPdb)">$([MSBuild]::NormalizePath('$(BinDir)', 'PDB', '$(CoreLibAssemblyName).ni.pdb'))</CoreLibNiPdbPath>
+      <CoreLibPerfMapPath Condition="$(BuildPerfMap)">$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).perf.map'))</CoreLibPerfMapPath>
+    </PropertyGroup>
+  </Target>
 
+  <Target Name="InvokeCrossgen"
+          DependsOnTargets="PrepareForCrossgen"
+          Inputs="$(CoreLibInputPath)"
+          Outputs="$(CoreLibOutputPath);$(CoreLibNiPdbPath);$(CoreLibPerfMapPath)"
+          AfterTargets="Build">
+
+    <PropertyGroup>
       <CrossGen1Cmd>$([MSBuild]::NormalizePath('$(BinDir)', '$(CrossDir)', 'crossgen$(ExeExtension)'))</CrossGen1Cmd>
       <CrossGen1Cmd>$(CrossGen1Cmd) /nologo</CrossGen1Cmd>
       <CrossGen1Cmd>$(CrossGen1Cmd) <!-- IbcTuning --></CrossGen1Cmd>