summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets
blob: e8eefb0f69ae40115238d392715cfe2751f3fdeb (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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <CompileDependsOn>_CreateILLinkRuntimeRootDescriptorFile;$(CompileDependsOn)</CompileDependsOn>
  </PropertyGroup>

  <PropertyGroup>
    <_ILLinkRuntimeRootDescriptorFileName Condition=" '$(_ILLinkRuntimeRootDescriptorFileName)' == '' ">System.Private.CoreLib.xml</_ILLinkRuntimeRootDescriptorFileName>
    <_ILLinkRuntimeRootDescriptorFilePath Condition=" '$(_ILLinkRuntimeRootDescriptorFilePath)' == '' ">$(IntermediateOutputPath)$(_ILLinkRuntimeRootDescriptorFileName)</_ILLinkRuntimeRootDescriptorFilePath>
    <_NamespaceFilePath Condition=" '$(_NamespaceFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\namespace.h</_NamespaceFilePath>
    <_MscorlibFilePath Condition=" '$(_MscorlibFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\mscorlib.h</_MscorlibFilePath>
    <_CortypeFilePath Condition=" '$(_CortypeFilePath)' == '' ">$(MSBuildThisFileDirectory)..\inc\cortypeinfo.h</_CortypeFilePath>
    <_RexcepFilePath Condition=" '$(_RexcepFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\rexcep.h</_RexcepFilePath>
    <_ILLinkTrimXmlFilePath Condition=" '$(_ILLinkTrimXmlFilePath)' == '' ">$(MSBuildThisFileDirectory)ILLinkTrim.xml</_ILLinkTrimXmlFilePath>
    <_ILLinkTasksToolsDir>$(PackagesDir)/illink.tasks/$(ILLinkTasksPackageVersion)/tools</_ILLinkTasksToolsDir>
    <_ILLinkTasksDir>$(_ILLinkTasksToolsDir)/net46/</_ILLinkTasksDir>
    <_ILLinkTasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(_ILLinkTasksToolsDir)/netcoreapp2.0/</_ILLinkTasksDir>
  </PropertyGroup>

  <!-- 
        Generates the xml root descriptor file for ILLink. The file contains roots required by the runtime. 
        This gets generated by mono IL linker which lives in https://github.com/mono/linker 
        If it fails, it'll spit out some cryptic error messages that's hard to debug.
        You can debug it by setting /maxcpucount:1 in the msbuild command to force it to not spawn up a bunch
        of child processes, and attach a debugger to msbuild. After that you can set a bp on the exception
        you are seeing.
  -->
  <UsingTask TaskName="CreateRuntimeRootILLinkDescriptorFile" AssemblyFile="$(_ILLinkTasksDir)ILLink.Tasks.dll" />
  <Target Name="_CreateILLinkRuntimeRootDescriptorFile"
          Inputs="$(_NamespaceFilePath);$(_MscorlibFilePath);$(_CortypeFilePath);$(_RexcepFilePath);$(_ILLinkTrimXmlFilePath)"
          Outputs="$(_ILLinkRuntimeRootDescriptorFilePath)">
    <Message Text="Generating ILLink roots file: $(_ILLinkRuntimeRootDescriptorFilePath)" />
    <CreateRuntimeRootILLinkDescriptorFile NamespaceFilePath="$(_NamespaceFilePath)"
                                           MscorlibFilePath="$(_MscorlibFilePath)"
                                           CortypeFilePath="$(_CortypeFilePath)"
                                           RexcepFilePath="$(_RexcepFilePath)"
                                           ILLinkTrimXmlFilePath="$(_ILLinkTrimXmlFilePath)"
                                           RuntimeRootDescriptorFilePath="$(_ILLinkRuntimeRootDescriptorFilePath)" />
  </Target>
</Project>