forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateRuntimeRootILLinkDescriptorFile.targets
More file actions
60 lines (52 loc) · 3.62 KB
/
CreateRuntimeRootILLinkDescriptorFile.targets
File metadata and controls
60 lines (52 loc) · 3.62 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CompileDependsOn>_CreateILLinkRuntimeRootDescriptorFile;$(CompileDependsOn)</CompileDependsOn>
</PropertyGroup>
<PropertyGroup>
<_ILLinkRuntimeRootDescriptorFilePath>$(ILLinkTrimXml)</_ILLinkRuntimeRootDescriptorFilePath>
<_NamespaceFilePath Condition=" '$(_NamespaceFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\namespace.h</_NamespaceFilePath>
<_MscorlibFilePath Condition=" '$(_MscorlibFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\corelib.h</_MscorlibFilePath>
<_CortypeFilePath Condition=" '$(_CortypeFilePath)' == '' ">$(MSBuildThisFileDirectory)..\inc\cortypeinfo.h</_CortypeFilePath>
<_RexcepFilePath Condition=" '$(_RexcepFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\rexcep.h</_RexcepFilePath>
<_ILLinkDescriptorsIntermediatePath>$(IntermediateOutputPath)ILLink.Descriptors.Combined.xml</_ILLinkDescriptorsIntermediatePath>
<_ILLinkTasksToolsDir>$(PkgMicrosoft_NET_ILLink_Tasks)/tools</_ILLinkTasksToolsDir>
<_ILLinkTasksDir>$(_ILLinkTasksToolsDir)/net472/</_ILLinkTasksDir>
<_ILLinkTasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(_ILLinkTasksToolsDir)/net5.0/</_ILLinkTasksDir>
<_ILLinkTasksPath>$(_ILLinkTasksDir)ILLink.Tasks.dll</_ILLinkTasksPath>
</PropertyGroup>
<ItemGroup>
<_ILLinkDescriptorsFilePaths Include="$(ILLinkDirectory)ILLinkTrim.xml" />
<_ILLinkDescriptorsFilePaths Include="$(CoreLibSharedDir)ILLink\ILLink.Descriptors.Shared.xml" />
</ItemGroup>
<!--
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="$(_ILLinkTasksPath)" />
<Target Name="_CreateILLinkRuntimeRootDescriptorFile"
DependsOnTargets="_CombineILLinkTrimXmlFilePaths"
Inputs="$(_NamespaceFilePath);$(_MscorlibFilePath);$(_CortypeFilePath);$(_RexcepFilePath);$(_ILLinkDescriptorsIntermediatePath)"
Outputs="$(_ILLinkRuntimeRootDescriptorFilePath)">
<Message Text="Generating ILLink roots file: $(_ILLinkRuntimeRootDescriptorFilePath)" />
<CreateRuntimeRootILLinkDescriptorFile NamespaceFilePath="$(_NamespaceFilePath)"
MscorlibFilePath="$(_MscorlibFilePath)"
CortypeFilePath="$(_CortypeFilePath)"
RexcepFilePath="$(_RexcepFilePath)"
ILLinkTrimXmlFilePath="$(_ILLinkDescriptorsIntermediatePath)"
RuntimeRootDescriptorFilePath="$(_ILLinkRuntimeRootDescriptorFilePath)" />
</Target>
<UsingTask TaskName="CombineLinkerXmlFiles" AssemblyFile="$(_ILLinkTasksPath)" />
<Target Name="_CombineILLinkTrimXmlFilePaths"
Inputs="@(_ILLinkDescriptorsFilePaths)"
Outputs="$(_ILLinkDescriptorsIntermediatePath)">
<CombineLinkerXmlFiles LinkerXmlFiles="@(_ILLinkDescriptorsFilePaths)"
CombinedLinkerXmlFile="$(_ILLinkDescriptorsIntermediatePath)" />
<ItemGroup>
<FileWrites Include="$(_ILLinkDescriptorsXmlIntermediatePath)" />
</ItemGroup>
</Target>
</Project>