-
Notifications
You must be signed in to change notification settings - Fork 37
/
yasm.targets
94 lines (94 loc) · 3.69 KB
/
yasm.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PropertyPageSchema
Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName Include="YASM">
<Targets>_YASM</Targets>
</AvailableItemName>
</ItemGroup>
<PropertyGroup>
<ComputeLinkInputsTargets>
$(ComputeLinkInputsTargets);
ComputeYASMOutput;
</ComputeLinkInputsTargets>
<ComputeLibInputsTargets>
$(ComputeLibInputsTargets);
ComputeYASMOutput;
</ComputeLibInputsTargets>
</PropertyGroup>
<UsingTask
TaskName="YASM"
TaskFactory="XamlTaskFactory"
AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
</UsingTask>
<Target
Name="_WriteYasmTlogs"
Condition="'@(YASM)' != '' and '@(SelectedFiles)' == ''">
<ItemGroup>
<YASM Remove="@(YASM)" Condition="'%(YASM.ExcludedFromBuild)' == 'true' or '%(YASM.ObjectFileName)' == ''" />
</ItemGroup>
<ItemGroup Condition="'@(YASM)' != ''">
<_YasmReadTlog Include="^%(YASM.FullPath);%(YASM.AdditionalDependencies)" />
<_YasmWriteTlog Include="^%(YASM.FullPath);$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '%(YASM.ObjectFileName)'))" />
</ItemGroup>
<WriteLinesToFile
Condition="'@(_YasmReadTlog)' != ''"
File="$(TLogLocation)Yasm.read.1u.tlog"
Lines="@(_YasmReadTlog->MetaData('Identity')->ToUpperInvariant());"
Overwrite="true"
Encoding="Unicode"/>
<WriteLinesToFile
Condition="'@(_YasmWriteTlog)' != ''"
File="$(TLogLocation)Yasm.write.1u.tlog"
Lines="@(_YasmWriteTlog->MetaData('Identity')->ToUpperInvariant());"
Overwrite="true"
Encoding="Unicode"/>
<ItemGroup>
<_YasmReadTlog Remove="@(_YasmReadTlog)" />
<_YasmWriteTlog Remove="@(_YasmWriteTlog)" />
</ItemGroup>
</Target>
<Target
Name="_YASM"
BeforeTargets="$(YASMBeforeTargets)"
AfterTargets="$(YASMAfterTargets)"
Condition="'@(YASM)' != ''"
Outputs="%(YASM.ObjectFileName)"
Inputs="%(YASM.Identity);%(YASM.AdditionalDependencies);$(MSBuildProjectFile)"
DependsOnTargets="_SelectedFiles">
<ItemGroup Condition="'@(SelectedFiles)' != ''">
<YASM Remove="@(YASM)" Condition="'%(Identity)' != '@(SelectedFiles)'" />
</ItemGroup>
<Message
Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'"
Importance="High"
Text="%(YASM.ExecutionDescription)" />
<YASM
Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'"
Inputs="%(YASM.Inputs)"
ObjectFileName="%(YASM.ObjectFileName)"
SymbolsPrefix="%(YASM.SymbolsPrefix)"
SymbolsPostfix="%(YASM.SymbolsPostfix)"
GenerateDebugInformation="%(YASM.GenerateDebugInformation)"
IncludePaths="%(YASM.IncludePaths)"
PreIncludeFiles="%(YASM.PreIncludeFiles)"
PreprocessorDefinitions="%(YASM.PreprocessorDefinitions)"
UndefinePreprocessorDefinitions="%(YASM.UndefinePreprocessorDefinitions)"
Preprocessor="%(YASM.Preprocessor)"
Parser="%(YASM.Parser)"
TreatWarningsAsErrors="%(YASM.TreatWarningsAsErrors)"
CommandLineTemplate="%(YASM.CommandLineTemplate)"
AdditionalOptions="%(YASM.AdditionalOptions)"
/>
</Target>
<Target
Name="ComputeYASMOutput"
Condition="'@(YASM)' != ''">
<ItemGroup>
<Link Include="@(YASM->Metadata('ObjectFileName')->Distinct()->ClearMetadata())" Condition="'%(YASM.ExcludedFromBuild)' != 'true'"/>
<Lib Include="@(YASM->Metadata('ObjectFileName')->Distinct()->ClearMetadata())" Condition="'%(YASM.ExcludedFromBuild)' != 'true'"/>
</ItemGroup>
</Target>
</Project>