-
Notifications
You must be signed in to change notification settings - Fork 2
/
mpl.targets
62 lines (54 loc) · 2.38 KB
/
mpl.targets
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
61
62
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ProjectTools Include="LLVM"/>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"/>
</ItemGroup>
<UsingTask
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" TaskFactory="CodeTaskFactory" TaskName="MplMultiTaskTool">
<ParameterGroup>
<Sources ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true"/>
<ToolExe Required="false"/>
<TrackerLogDirectory Required="false"/>
</ParameterGroup>
<Task>
<Code Language="cs" Source="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).cs" Type="Class"/>
<Reference Include="$(VCTargetsPath)Microsoft.Build.CppTasks.Common.dll"/>
</Task>
</UsingTask>
<UsingTask
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" TaskFactory="CodeTaskFactory" TaskName="MplCompile">
<ParameterGroup>
<InputFiles ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true"/>
<TrackerLogsFolder Required="true"/>
</ParameterGroup>
<Task>
<Code Language="cs" Source="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).cs" Type="Class"/>
<Reference Include="$(VCTargetsPath)Microsoft.Build.CppTasks.Common.dll"/>
</Task>
</UsingTask>
<Target Name="MplPreCompile" BeforeTargets="LlvmPreCompile" Condition="false"/>
<Target Name="MplCompile" AfterTargets="MplPreCompile" Condition="@(MPL) != ''">
<ItemGroup>
<!-- Remove files that are excluded from build -->
<MPL Condition="%(MPL.ExcludedFromBuild) == true" Remove="@(MPL)"/>
<!-- Replace output file for files without partial compilation -->
<MPL Condition="%(MPL.PartialCompilation) != true" OutputFile="$(IntDir)mpl.ll"/>
</ItemGroup>
<!-- Compile files without partial compilation -->
<MplCompile
Condition="%(MPL.PartialCompilation) != true"
InputFiles="@(MPL)"
TrackerLogsFolder="$(TLogLocation)"/>
<!-- Compile files with partial compilation -->
<MplMultiTaskTool
Condition="%(MPL.PartialCompilation) == true"
Sources="@(MPL)"
ToolExe="%(CompilerPath)"
TrackerLogDirectory="$(TLogLocation)"/>
<!-- Prepare outputs for the next stage -->
<ItemGroup>
<LLVM Include="%(MPL.OutputFile)"/>
</ItemGroup>
</Target>
</Project>