|
7 | 7 | <Targets>_NASM</Targets> |
8 | 8 | </AvailableItemName> |
9 | 9 | </ItemGroup> |
10 | | - |
11 | 10 | <PropertyGroup> |
12 | 11 | <ComputeLinkInputsTargets> |
13 | 12 | $(ComputeLinkInputsTargets); |
14 | 13 | ComputeNASMOutput; |
15 | 14 | </ComputeLinkInputsTargets> |
16 | 15 | </PropertyGroup> |
17 | | - |
18 | 16 | <PropertyGroup> |
19 | 17 | <ComputeLibInputsTargets> |
20 | 18 | $(ComputeLibInputsTargets); |
21 | 19 | ComputeNASMOutput; |
22 | 20 | </ComputeLibInputsTargets> |
23 | 21 | </PropertyGroup> |
24 | | - |
25 | 22 | <PropertyGroup> |
26 | 23 | <ComputeImpLibInputsTargets> |
27 | 24 | $(ComputeImpLibInputsTargets); |
28 | 25 | ComputeNASMOutput; |
29 | 26 | </ComputeImpLibInputsTargets> |
30 | 27 | </PropertyGroup> |
31 | | - |
32 | 28 | <UsingTask |
33 | 29 | TaskName="NASM" |
34 | 30 | TaskFactory="XamlTaskFactory" |
35 | 31 | AssemblyName="Microsoft.Build.Tasks.v4.0"> |
36 | 32 | <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task> |
37 | 33 | </UsingTask> |
38 | | - |
39 | 34 | <!-- ******************************************************************************************* |
40 | 35 | NASM |
41 | 36 | ******************************************************************************************* --> |
42 | | - |
43 | 37 | <PropertyGroup Condition="'$(NASMAfterTargets)'!='' or '$(NASMBeforeTargets)'!=''"> |
44 | 38 | <NASMToolBeforeTargets>$(NASMBeforeTargets)</NASMToolBeforeTargets> |
45 | 39 | <NASMToolAfterTargets>$(NASMAfterTargets)</NASMToolAfterTargets> |
46 | 40 | </PropertyGroup> |
47 | | - |
48 | 41 | <!--If no before/after targets are set, then set the default--> |
49 | 42 | <PropertyGroup Condition="'$(NASMAfterTargets)'=='' and '$(NASMBeforeTargets)'==''"> |
50 | 43 | <NASMToolBeforeTargets>Midl</NASMToolBeforeTargets> |
51 | 44 | <NASMToolAfterTargets>PreBuildEvent</NASMToolAfterTargets> |
52 | 45 | <NASMBeforeTargets>PostBuildEvent</NASMBeforeTargets> |
53 | 46 | <NASMAfterTargets>BscMake</NASMAfterTargets> |
54 | 47 | </PropertyGroup> |
55 | | - |
56 | 48 | <!-- If Selective File Build is enabled, then dont let custom interupt the build order--> |
57 | 49 | <PropertyGroup Condition="'$(SelectedFiles)'!=''"> |
58 | 50 | <NASMToolBeforeTargets></NASMToolBeforeTargets> |
59 | 51 | <NASMToolAfterTargets></NASMToolAfterTargets> |
60 | 52 | <NASMBeforeTargets></NASMBeforeTargets> |
61 | 53 | <NASMAfterTargets></NASMAfterTargets> |
62 | 54 | </PropertyGroup> |
63 | | - |
64 | 55 | <Target Name="_NASM" |
65 | 56 | BeforeTargets="$(NASMToolBeforeTargets)" |
66 | 57 | AfterTargets="$(NASMToolAfterTargets)" |
67 | 58 | DependsOnTargets="SelectNASM;ComputeNASMOutput"> |
68 | | - |
69 | 59 | <PropertyGroup> |
70 | 60 | <CustomBuildToolArchitecture Condition="'$(CustomBuildToolArchitecture)' == ''">Native32Bit</CustomBuildToolArchitecture> |
71 | 61 | </PropertyGroup> |
72 | | - |
73 | 62 | <ItemGroup> |
74 | 63 | <NASM Update="@(NASM)"> |
75 | 64 | <Inputs>%(NASM.FullPath);%(NASM.AdditionalDependencies);$(MSBuildProjectFile)</Inputs> |
76 | 65 | <AdditionalInputs>%(NASM.FullPath);%(NASM.AdditionalDependencies);$(MSBuildProjectFile)</AdditionalInputs> |
77 | | - |
78 | 66 | <Message>%(NASM.ExecutionDescription)</Message> |
79 | | - |
80 | | - <!-- option fragments used for [AllOptions] --> |
| 67 | + <!-- Option fragments used for [AllOptions] --> |
81 | 68 | <_NasmOpt_Debug></_NasmOpt_Debug> |
82 | 69 | <_NasmOpt_Prefix></_NasmOpt_Prefix> |
83 | 70 | <_NasmOpt_Postfix></_NasmOpt_Postfix> |
|
86 | 73 | <_NasmOpt_Defines></_NasmOpt_Defines> |
87 | 74 | <_NasmOpt_Undefines></_NasmOpt_Undefines> |
88 | 75 | <_NasmOpt_Werror></_NasmOpt_Werror> |
89 | | - |
90 | 76 | <_NasmOpt_Debug Condition="'%(NASM.GenerateDebugInformation)' == 'true'">-g</_NasmOpt_Debug> |
91 | 77 | <_NasmOpt_Prefix Condition="'%(NASM.SymbolsPrefix)' != ''">--prefix %(NASM.SymbolsPrefix)</_NasmOpt_Prefix> |
92 | 78 | <_NasmOpt_Postfix Condition="'%(NASM.SymbolsPostfix)' != ''">--postfix %(NASM.SymbolsPostfix)</_NasmOpt_Postfix> |
|
97 | 83 | <_NasmOpt_Werror Condition="'%(NASM.TreatWarningsAsErrors)' == 'true'">-Werror</_NasmOpt_Werror> |
98 | 84 | </NASM> |
99 | 85 | </ItemGroup> |
100 | | - |
101 | 86 | <ItemGroup> |
102 | 87 | <NASM Update="@(NASM)"> |
103 | 88 | <_NasmAllOptions>-o "%(NASM.Outputs)" %(NASM._NasmOpt_Debug) %(NASM._NasmOpt_Prefix) %(NASM._NasmOpt_Postfix) %(NASM._NasmOpt_IncludePaths) %(NASM._NasmOpt_PreIncludeFiles) %(NASM._NasmOpt_Defines) %(NASM._NasmOpt_Undefines) %(NASM._NasmOpt_Werror)</_NasmAllOptions> |
104 | 89 | </NASM> |
105 | 90 | </ItemGroup> |
106 | | - |
107 | 91 | <ItemGroup> |
108 | 92 | <NASM Update="@(NASM)"> |
109 | 93 | <Command>$([System.String]::Copy('%(NASM.CommandLineTemplate)').Replace('[AllOptions]', '%(NASM._NasmAllOptions)').Replace('[AdditionalOptions]', '%(NASM.AdditionalOptions)'))</Command> |
110 | 94 | </NASM> |
111 | 95 | </ItemGroup> |
112 | | - |
113 | | - <!-- delete old ParallelCustomBuild tlogs, same as CustomBuild --> |
| 96 | + <!-- Delete old ParallelCustomBuild tlogs, same as CustomBuild --> |
114 | 97 | <GetOutOfDateItems |
115 | 98 | Sources ="@(_EmptyItemGroup)" |
116 | 99 | OutputsMetadataName ="Outputs" |
|
120 | 103 | TLogNamePrefix ="ParallelNasmBuild" |
121 | 104 | TrackFileAccess ="$(TrackFileAccess)" |
122 | 105 | /> |
123 | | - |
124 | 106 | <!-- Get out of date items for NASM (full build case) --> |
125 | 107 | <GetOutOfDateItems |
126 | 108 | Condition ="'$(SelectedFiles)' == ''" |
|
134 | 116 | CheckForInterdependencies ="true"> |
135 | 117 | <Output TaskParameter="OutOfDateSources" ItemName="_NasmBuild" /> |
136 | 118 | </GetOutOfDateItems> |
137 | | - |
138 | 119 | <!-- Selected-files build: just take all NASM items --> |
139 | 120 | <ItemGroup Condition ="'$(SelectedFiles)' != ''"> |
140 | 121 | <_NasmBuild Include="@(NASM)" /> |
141 | 122 | </ItemGroup> |
142 | | - |
143 | 123 | <!-- Build items which can be built in parallel (ignored for selected-files build) --> |
144 | 124 | <ItemGroup Condition="'$(SelectedFiles)' == ''"> |
145 | 125 | <_ParallelNasmBuild Include="@(_NasmBuild)" |
146 | 126 | Condition="'%(_NasmBuild.BuildInParallel)' == 'true' and '%(_NasmBuild.DependsOnAnotherItemOutput)' != 'true'" /> |
147 | 127 | </ItemGroup> |
148 | | - |
149 | 128 | <ParallelCustomBuild |
150 | 129 | Condition ="'@(_ParallelNasmBuild)' != ''" |
151 | 130 | Sources ="@(_ParallelNasmBuild)" |
|
156 | 135 | StdErrEncoding ="%(_ParallelNasmBuild.StdErrEncoding)" |
157 | 136 | UseMsbuildResourceManager ="$(UseMsbuildResourceManager)" |
158 | 137 | /> |
159 | | - |
160 | | - <!-- build the remaining items sequentially --> |
| 138 | + <!-- Build the remaining items sequentially --> |
161 | 139 | <ItemGroup Condition="'@(_ParallelNasmBuild)' != ''"> |
162 | 140 | <_NasmBuild Remove="@(_ParallelNasmBuild)" /> |
163 | 141 | <_ParallelNasmBuild Remove="@(_ParallelNasmBuild)" /> |
164 | 142 | </ItemGroup> |
165 | | - |
166 | 143 | <CustomBuild Condition ="'@(_NasmBuild)' != ''" |
167 | 144 | Sources ="@(_NasmBuild)" |
168 | 145 | BuildSuffix ="$(_BuildSuffix)" |
|
171 | 148 | StdOutEncoding ="%(_NasmBuild.StdOutEncoding)" |
172 | 149 | StdErrEncoding ="%(_NasmBuild.StdErrEncoding)"> |
173 | 150 | </CustomBuild> |
174 | | - |
175 | 151 | <ItemGroup Condition="'@(_NasmBuild)' != ''"> |
176 | 152 | <_NasmBuild Remove="@(_NasmBuild)" /> |
177 | 153 | </ItemGroup> |
178 | | - |
179 | 154 | </Target> |
180 | | - |
181 | 155 | <Target Name="SelectNASM" DependsOnTargets="_SelectedFiles"> |
182 | 156 | <ItemGroup Condition="'@(SelectedFiles)'!=''"> |
183 | 157 | <NASM Remove="@(NASM)" Condition="'%(Identity)'!='@(SelectedFiles)'"/> |
|
191 | 165 | </NASM> |
192 | 166 | </ItemGroup> |
193 | 167 | </Target> |
194 | | - |
195 | | - |
196 | 168 | <Target Name="ComputeNASMOutput" DependsOnTargets="SelectNASM" > |
197 | | - |
198 | 169 | <ItemGroup > |
199 | 170 | <NASMOutputs Include="@(NASM->Metadata('Outputs'))" Condition="'@(NASM)' != ''"/> |
200 | 171 |
|
|
206 | 177 | <OutputItemType Condition="'$(ConfigurationType)'!='StaticLibrary'">Link</OutputItemType> |
207 | 178 | </NASMOutputs> |
208 | 179 | </ItemGroup> |
209 | | - |
210 | 180 | <!-- Add NASM Outputs to lib, link or other tools --> |
211 | 181 | <CreateItem |
212 | 182 | Include="@(NASMOutputs)" |
|
219 | 189 | Condition="'%(NASMOutputs.OutputItemType)' == 'Link' and '$(GenerateImportLib)'=='true'" |
220 | 190 | ItemName="ImpLib"/> |
221 | 191 | </CreateItem> |
222 | | - |
223 | 192 | <MakeDir Directories="@(NASMOutputs->'%(RootDir)%(Directory)')" /> |
224 | | - |
225 | 193 | <!-- Cleanup --> |
226 | 194 | <ItemGroup> |
227 | 195 | <NASMOutputs Remove="@(NASMOutputs)" /> |
228 | 196 | </ItemGroup> |
229 | | - |
230 | 197 | </Target> |
231 | | - |
232 | | - |
233 | 198 | </Project> |
0 commit comments