Skip to content

Commit 17e2963

Browse files
committed
Cleanup white space.
1 parent 459a750 commit 17e2963

3 files changed

Lines changed: 7 additions & 68 deletions

File tree

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ VSNASM
77
[![license](https://img.shields.io/github/license/ShiftMediaProject/VSNASM.svg)](https://github.com/ShiftMediaProject/VSNASM)
88
[![donate](https://img.shields.io/badge/donate-link-brightgreen.svg)](https://shiftmediaproject.github.io/8-donate/)
99

10-
## New Version 2.0
11-
12-
### Major Update with Parallel Build Support
13-
14-
**Changes**
15-
16-
- Added support for PARALLEL NASM builds
17-
- Proper change detection for NASM files
18-
(rebuilds when the NASM file or its dependencies have changed)
19-
- Incremental Builds working reliably
20-
- Clean is working properly
21-
(doesn't start building NASM files when you clean the project)
22-
2310
## About
2411

2512
This project provides a set of build customisations that can be used within Visual Studio to compile assembly code using NASM.

nasm.targets

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,77 +7,64 @@
77
<Targets>_NASM</Targets>
88
</AvailableItemName>
99
</ItemGroup>
10-
1110
<PropertyGroup>
1211
<ComputeLinkInputsTargets>
1312
$(ComputeLinkInputsTargets);
1413
ComputeNASMOutput;
1514
</ComputeLinkInputsTargets>
1615
</PropertyGroup>
17-
1816
<PropertyGroup>
1917
<ComputeLibInputsTargets>
2018
$(ComputeLibInputsTargets);
2119
ComputeNASMOutput;
2220
</ComputeLibInputsTargets>
2321
</PropertyGroup>
24-
2522
<PropertyGroup>
2623
<ComputeImpLibInputsTargets>
2724
$(ComputeImpLibInputsTargets);
2825
ComputeNASMOutput;
2926
</ComputeImpLibInputsTargets>
3027
</PropertyGroup>
31-
3228
<UsingTask
3329
TaskName="NASM"
3430
TaskFactory="XamlTaskFactory"
3531
AssemblyName="Microsoft.Build.Tasks.v4.0">
3632
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
3733
</UsingTask>
38-
3934
<!-- *******************************************************************************************
4035
NASM
4136
******************************************************************************************* -->
42-
4337
<PropertyGroup Condition="'$(NASMAfterTargets)'!='' or '$(NASMBeforeTargets)'!=''">
4438
<NASMToolBeforeTargets>$(NASMBeforeTargets)</NASMToolBeforeTargets>
4539
<NASMToolAfterTargets>$(NASMAfterTargets)</NASMToolAfterTargets>
4640
</PropertyGroup>
47-
4841
<!--If no before/after targets are set, then set the default-->
4942
<PropertyGroup Condition="'$(NASMAfterTargets)'=='' and '$(NASMBeforeTargets)'==''">
5043
<NASMToolBeforeTargets>Midl</NASMToolBeforeTargets>
5144
<NASMToolAfterTargets>PreBuildEvent</NASMToolAfterTargets>
5245
<NASMBeforeTargets>PostBuildEvent</NASMBeforeTargets>
5346
<NASMAfterTargets>BscMake</NASMAfterTargets>
5447
</PropertyGroup>
55-
5648
<!-- If Selective File Build is enabled, then dont let custom interupt the build order-->
5749
<PropertyGroup Condition="'$(SelectedFiles)'!=''">
5850
<NASMToolBeforeTargets></NASMToolBeforeTargets>
5951
<NASMToolAfterTargets></NASMToolAfterTargets>
6052
<NASMBeforeTargets></NASMBeforeTargets>
6153
<NASMAfterTargets></NASMAfterTargets>
6254
</PropertyGroup>
63-
6455
<Target Name="_NASM"
6556
BeforeTargets="$(NASMToolBeforeTargets)"
6657
AfterTargets="$(NASMToolAfterTargets)"
6758
DependsOnTargets="SelectNASM;ComputeNASMOutput">
68-
6959
<PropertyGroup>
7060
<CustomBuildToolArchitecture Condition="'$(CustomBuildToolArchitecture)' == ''">Native32Bit</CustomBuildToolArchitecture>
7161
</PropertyGroup>
72-
7362
<ItemGroup>
7463
<NASM Update="@(NASM)">
7564
<Inputs>%(NASM.FullPath);%(NASM.AdditionalDependencies);$(MSBuildProjectFile)</Inputs>
7665
<AdditionalInputs>%(NASM.FullPath);%(NASM.AdditionalDependencies);$(MSBuildProjectFile)</AdditionalInputs>
77-
7866
<Message>%(NASM.ExecutionDescription)</Message>
79-
80-
<!-- option fragments used for [AllOptions] -->
67+
<!-- Option fragments used for [AllOptions] -->
8168
<_NasmOpt_Debug></_NasmOpt_Debug>
8269
<_NasmOpt_Prefix></_NasmOpt_Prefix>
8370
<_NasmOpt_Postfix></_NasmOpt_Postfix>
@@ -86,7 +73,6 @@
8673
<_NasmOpt_Defines></_NasmOpt_Defines>
8774
<_NasmOpt_Undefines></_NasmOpt_Undefines>
8875
<_NasmOpt_Werror></_NasmOpt_Werror>
89-
9076
<_NasmOpt_Debug Condition="'%(NASM.GenerateDebugInformation)' == 'true'">-g</_NasmOpt_Debug>
9177
<_NasmOpt_Prefix Condition="'%(NASM.SymbolsPrefix)' != ''">--prefix %(NASM.SymbolsPrefix)</_NasmOpt_Prefix>
9278
<_NasmOpt_Postfix Condition="'%(NASM.SymbolsPostfix)' != ''">--postfix %(NASM.SymbolsPostfix)</_NasmOpt_Postfix>
@@ -97,20 +83,17 @@
9783
<_NasmOpt_Werror Condition="'%(NASM.TreatWarningsAsErrors)' == 'true'">-Werror</_NasmOpt_Werror>
9884
</NASM>
9985
</ItemGroup>
100-
10186
<ItemGroup>
10287
<NASM Update="@(NASM)">
10388
<_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>
10489
</NASM>
10590
</ItemGroup>
106-
10791
<ItemGroup>
10892
<NASM Update="@(NASM)">
10993
<Command>$([System.String]::Copy('%(NASM.CommandLineTemplate)').Replace('[AllOptions]', '%(NASM._NasmAllOptions)').Replace('[AdditionalOptions]', '%(NASM.AdditionalOptions)'))</Command>
11094
</NASM>
11195
</ItemGroup>
112-
113-
<!-- delete old ParallelCustomBuild tlogs, same as CustomBuild -->
96+
<!-- Delete old ParallelCustomBuild tlogs, same as CustomBuild -->
11497
<GetOutOfDateItems
11598
Sources ="@(_EmptyItemGroup)"
11699
OutputsMetadataName ="Outputs"
@@ -120,7 +103,6 @@
120103
TLogNamePrefix ="ParallelNasmBuild"
121104
TrackFileAccess ="$(TrackFileAccess)"
122105
/>
123-
124106
<!-- Get out of date items for NASM (full build case) -->
125107
<GetOutOfDateItems
126108
Condition ="'$(SelectedFiles)' == ''"
@@ -134,18 +116,15 @@
134116
CheckForInterdependencies ="true">
135117
<Output TaskParameter="OutOfDateSources" ItemName="_NasmBuild" />
136118
</GetOutOfDateItems>
137-
138119
<!-- Selected-files build: just take all NASM items -->
139120
<ItemGroup Condition ="'$(SelectedFiles)' != ''">
140121
<_NasmBuild Include="@(NASM)" />
141122
</ItemGroup>
142-
143123
<!-- Build items which can be built in parallel (ignored for selected-files build) -->
144124
<ItemGroup Condition="'$(SelectedFiles)' == ''">
145125
<_ParallelNasmBuild Include="@(_NasmBuild)"
146126
Condition="'%(_NasmBuild.BuildInParallel)' == 'true' and '%(_NasmBuild.DependsOnAnotherItemOutput)' != 'true'" />
147127
</ItemGroup>
148-
149128
<ParallelCustomBuild
150129
Condition ="'@(_ParallelNasmBuild)' != ''"
151130
Sources ="@(_ParallelNasmBuild)"
@@ -156,13 +135,11 @@
156135
StdErrEncoding ="%(_ParallelNasmBuild.StdErrEncoding)"
157136
UseMsbuildResourceManager ="$(UseMsbuildResourceManager)"
158137
/>
159-
160-
<!-- build the remaining items sequentially -->
138+
<!-- Build the remaining items sequentially -->
161139
<ItemGroup Condition="'@(_ParallelNasmBuild)' != ''">
162140
<_NasmBuild Remove="@(_ParallelNasmBuild)" />
163141
<_ParallelNasmBuild Remove="@(_ParallelNasmBuild)" />
164142
</ItemGroup>
165-
166143
<CustomBuild Condition ="'@(_NasmBuild)' != ''"
167144
Sources ="@(_NasmBuild)"
168145
BuildSuffix ="$(_BuildSuffix)"
@@ -171,13 +148,10 @@
171148
StdOutEncoding ="%(_NasmBuild.StdOutEncoding)"
172149
StdErrEncoding ="%(_NasmBuild.StdErrEncoding)">
173150
</CustomBuild>
174-
175151
<ItemGroup Condition="'@(_NasmBuild)' != ''">
176152
<_NasmBuild Remove="@(_NasmBuild)" />
177153
</ItemGroup>
178-
179154
</Target>
180-
181155
<Target Name="SelectNASM" DependsOnTargets="_SelectedFiles">
182156
<ItemGroup Condition="'@(SelectedFiles)'!=''">
183157
<NASM Remove="@(NASM)" Condition="'%(Identity)'!='@(SelectedFiles)'"/>
@@ -191,10 +165,7 @@
191165
</NASM>
192166
</ItemGroup>
193167
</Target>
194-
195-
196168
<Target Name="ComputeNASMOutput" DependsOnTargets="SelectNASM" >
197-
198169
<ItemGroup >
199170
<NASMOutputs Include="@(NASM->Metadata('Outputs'))" Condition="'@(NASM)' != ''"/>
200171

@@ -206,7 +177,6 @@
206177
<OutputItemType Condition="'$(ConfigurationType)'!='StaticLibrary'">Link</OutputItemType>
207178
</NASMOutputs>
208179
</ItemGroup>
209-
210180
<!-- Add NASM Outputs to lib, link or other tools -->
211181
<CreateItem
212182
Include="@(NASMOutputs)"
@@ -219,15 +189,10 @@
219189
Condition="'%(NASMOutputs.OutputItemType)' == 'Link' and '$(GenerateImportLib)'=='true'"
220190
ItemName="ImpLib"/>
221191
</CreateItem>
222-
223192
<MakeDir Directories="@(NASMOutputs->'%(RootDir)%(Directory)')" />
224-
225193
<!-- Cleanup -->
226194
<ItemGroup>
227195
<NASMOutputs Remove="@(NASMOutputs)" />
228196
</ItemGroup>
229-
230197
</Target>
231-
232-
233198
</Project>

nasm.xml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<Category Name="All Options" DisplayName="All Options" Subtype="Search" />
1919
<Category Name="Command Line" DisplayName="Command Line" Subtype="CommandLine" />
2020
</Rule.Categories>
21-
2221
<!-- General -->
2322
<StringListProperty
2423
Name="IncludePaths"
@@ -74,7 +73,6 @@
7473
HasConfigurationCondition="true" />
7574
</DynamicEnumProperty.DataSource>
7675
</DynamicEnumProperty>
77-
7876
<BoolProperty
7977
Name="BuildInParallel"
8078
Category="General"
@@ -96,15 +94,13 @@
9694
F1Keyword="VC.Project.VCCustomBuildTool.MaxProcesses"
9795
Description="Maximum number of items to execute together during parallel build. A value of 0 divides items evenly into parallel batches. A value of 1 disables batching. Larger batches will improve performance if the custom build tool processes items quickly.">
9896
</IntProperty>
99-
10097
<!-- Assembler Options -->
101-
10298
<StringProperty
10399
Name="Outputs"
104100
Category="Assembler Options"
105101
DisplayName="Output File Name"
106102
Description="Specify Output Filename."
107-
HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.1"
103+
HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.1"
108104
Switch="-o &quot;[value]&quot;" />
109105
<BoolProperty
110106
Name="GenerateDebugInformation"
@@ -119,28 +115,25 @@
119115
DisplayName="Symbols Prefix"
120116
Description="Prepend the given argument to all global or extern variables."
121117
HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.27"
122-
IncludeInCommandLine="False"
118+
IncludeInCommandLine="False"
123119
Switch="--prefix [value]" />
124120
<StringProperty
125121
Name="SymbolsPostfix"
126122
Category="Assembler Options"
127123
DisplayName="Symbols Postfix"
128124
Description="Append the given argument to all global or extern variables."
129125
HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.27"
130-
IncludeInCommandLine="False"
126+
IncludeInCommandLine="False"
131127
Switch="--postfix [value]" />
132128
<BoolProperty
133129
Name="TreatWarningsAsErrors"
134130
Category="Assembler Options"
135131
DisplayName="Treat Warnings As Errors"
136132
Description="Returns an error code if warnings are generated."
137133
HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.24"
138-
IncludeInCommandLine="False"
134+
IncludeInCommandLine="False"
139135
Switch="-Werror" />
140-
141-
142136
<!-- Preprocessor -->
143-
144137
<StringListProperty
145138
Name="PreprocessorDefinitions"
146139
Category="Preprocessor"
@@ -155,9 +148,7 @@
155148
Description="Undefines a text macro with the given name."
156149
HelpUrl="http://www.nasm.us/doc/nasmdoc2.html#section-2.1.19"
157150
Switch="-U[value]" />
158-
159151
<!-- Command Line -->
160-
161152
<StringProperty
162153
Name="Inputs"
163154
Category="Command Line"
@@ -176,10 +167,7 @@
176167
DisplayName="Additional Options"
177168
Description="Additional Options">
178169
</StringProperty>
179-
180-
181170
<!-- Hidden -->
182-
183171
<StringProperty
184172
Name="CommandLineTemplate"
185173
DisplayName="Command Line"
@@ -195,7 +183,6 @@
195183
DisplayName="Additional Dependencies"
196184
IncludeInCommandLine="False"
197185
Visible="False" />
198-
199186
</Rule>
200187
<ItemType
201188
Name="NASM"

0 commit comments

Comments
 (0)