-
Notifications
You must be signed in to change notification settings - Fork 52
/
nasm.targets
92 lines (92 loc) · 3.64 KB
/
nasm.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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PropertyPageSchema
Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName Include="NASM">
<Targets>_NASM</Targets>
</AvailableItemName>
</ItemGroup>
<PropertyGroup>
<ComputeLinkInputsTargets>
$(ComputeLinkInputsTargets);
ComputeNASMOutput;
</ComputeLinkInputsTargets>
<ComputeLibInputsTargets>
$(ComputeLibInputsTargets);
ComputeNASMOutput;
</ComputeLibInputsTargets>
</PropertyGroup>
<UsingTask
TaskName="NASM"
TaskFactory="XamlTaskFactory"
AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
</UsingTask>
<Target
Name="_WriteNasmTlogs"
Condition="'@(NASM)' != '' and '@(SelectedFiles)' == ''">
<ItemGroup>
<NASM Remove="@(NASM)" Condition="'%(NASM.ExcludedFromBuild)' == 'true' or '%(NASM.ObjectFileName)' == ''" />
</ItemGroup>
<ItemGroup Condition="'@(NASM)' != ''">
<_NasmReadTlog Include="^%(NASM.FullPath);%(NASM.AdditionalDependencies)" />
<_NasmWriteTlog Include="^%(NASM.FullPath);$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '%(NASM.ObjectFileName)'))" />
</ItemGroup>
<WriteLinesToFile
Condition="'@(_NasmReadTlog)' != ''"
File="$(TLogLocation)Nasm.read.1u.tlog"
Lines="@(_NasmReadTlog->MetaData('Identity')->ToUpperInvariant());"
Overwrite="true"
Encoding="Unicode"/>
<WriteLinesToFile
Condition="'@(_NasmWriteTlog)' != ''"
File="$(TLogLocation)Nasm.write.1u.tlog"
Lines="@(_NasmWriteTlog->MetaData('Identity')->ToUpperInvariant());"
Overwrite="true"
Encoding="Unicode"/>
<ItemGroup>
<_NasmReadTlog Remove="@(_NasmReadTlog)" />
<_NasmWriteTlog Remove="@(_NasmWriteTlog)" />
</ItemGroup>
</Target>
<Target
Name="_NASM"
BeforeTargets="$(NASMBeforeTargets)"
AfterTargets="$(NASMAfterTargets)"
Condition="'@(NASM)' != ''"
Outputs="%(NASM.ObjectFileName)"
Inputs="%(NASM.Identity);%(NASM.AdditionalDependencies);$(MSBuildProjectFile)"
DependsOnTargets="_WriteNasmTlogs;_SelectedFiles">
<ItemGroup Condition="'@(SelectedFiles)' != ''">
<NASM Remove="@(NASM)" Condition="'%(Identity)' != '@(SelectedFiles)'" />
</ItemGroup>
<Message
Condition="'@(NASM)' != '' and '%(NASM.ExcludedFromBuild)' != 'true'"
Importance="High"
Text="%(NASM.ExecutionDescription)" />
<NASM
Condition="'@(NASM)' != '' and '%(NASM.ExcludedFromBuild)' != 'true'"
Inputs="%(NASM.Inputs)"
ObjectFileName="%(NASM.ObjectFileName)"
SymbolsPrefix="%(NASM.SymbolsPrefix)"
SymbolsPostfix="%(NASM.SymbolsPostfix)"
GenerateDebugInformation="%(NASM.GenerateDebugInformation)"
IncludePaths="%(NASM.IncludePaths)"
PreIncludeFiles="%(NASM.PreIncludeFiles)"
PreprocessorDefinitions="%(NASM.PreprocessorDefinitions)"
UndefinePreprocessorDefinitions="%(NASM.UndefinePreprocessorDefinitions)"
TreatWarningsAsErrors="%(NASM.TreatWarningsAsErrors)"
CommandLineTemplate="%(NASM.CommandLineTemplate)"
AdditionalOptions="%(NASM.AdditionalOptions)"
/>
</Target>
<Target
Name="ComputeNASMOutput"
Condition="'@(NASM)' != ''">
<ItemGroup>
<Link Include="@(NASM->Metadata('ObjectFileName')->Distinct()->ClearMetadata())" Condition="'%(NASM.ExcludedFromBuild)' != 'true'"/>
<Lib Include="@(NASM->Metadata('ObjectFileName')->Distinct()->ClearMetadata())" Condition="'%(NASM.ExcludedFromBuild)' != 'true'"/>
</ItemGroup>
</Target>
</Project>