Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
cf258c89
Commit
cf258c89
authored
Jan 12, 2022
by
stijn
Committed by
Damien George
Jan 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows/msvc: Run qstr preprocessing phase in parallel.
Supported from VS2017 and up, this roughly halves build time.
parent
a3bbd533
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
ports/windows/msvc/genhdr.targets
ports/windows/msvc/genhdr.targets
+18
-3
No files found.
ports/windows/msvc/genhdr.targets
View file @
cf258c89
...
...
@@ -18,8 +18,14 @@
<PyPython
Condition=
"'$(PyPython)' == ''"
>
python
</PyPython>
<CLToolExe
Condition=
"'$(CLToolExe)' == ''"
>
cl.exe
</CLToolExe>
<PyClTool>
$([System.IO.Path]::Combine(`$(CLToolPath)`, `$(CLToolExe)`))
</PyClTool>
<PyPlatformToolsetNum>
120
</PyPlatformToolsetNum>
<!--Minimum we support is VS2013.-->
<PyPlatformToolsetNum
Condition=
"$(PlatformToolset.StartsWith('v'))"
>
$(PlatformToolset.Replace('v', ''))
</PyPlatformToolsetNum>
<PyParallelPreProc
Condition=
"'$(PyPlatformToolsetNum)' > '140'"
>
True
</PyParallelPreProc>
<!--VS2017 and up.-->
</PropertyGroup>
<UsingTask
Condition=
"'$(PyParallelPreProc)' == 'True'"
TaskName=
"ParallelCustomBuild"
AssemblyFile=
"$(VCTargetsPath)\Microsoft.Build.CppTasks.Common.dll"
/>
<Target
Name=
"MakeDestDir"
>
<MakeDir
Directories=
"$(DestDir)"
/>
</Target>
...
...
@@ -57,6 +63,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
<PyIncDirs
Include=
"$(PyIncDirs)"
/>
<PreProcDefs
Include=
"%(ClCompile.PreProcessorDefinitions);NO_QSTR"
/>
<PyQstrSourceFiles
Include=
"@(ClCompile)"
Exclude=
"$(PyBuildDir)\frozen_content.c"
>
<Changed>
False
</Changed>
<OutFile>
$([System.String]::new('%(FullPath)').Replace('$(PyBaseDir)', '$(DestDir)qstr\'))
</OutFile>
</PyQstrSourceFiles>
<PyQstrSourceFiles>
...
...
@@ -71,13 +78,21 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
</QstrDependencies>
</ItemGroup>
<PropertyGroup>
<PyPreProcCommand>
$(PyClTool) /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D')
</PyPreProcCommand>
<ForceQstrRebuild>
@(QstrDependencies->AnyHaveMetadataValue('Changed', 'True'))
</ForceQstrRebuild>
<RunPreProcConcat>
@(PyQstrSourceFiles->AnyHaveMetadataValue('Changed', 'True'))
</RunPreProcConcat>
</PropertyGroup>
<ItemGroup>
<PyQstrSourceFilesToPreProc
Include=
"@(PyQstrSourceFiles)"
Condition=
"'%(Changed)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"
>
<Command>
$(PyPreProcCommand) /Fi%(OutFile) /P %(Identity)
</Command>
<Outputs>
%(OutFile)
</Outputs>
</PyQstrSourceFilesToPreProc>
</ItemGroup>
<MakeDir
Directories=
"@(PyQstrSourceFilesToPreProc->'%(OutDir)')"
/>
<Exec
Condition=
"'$(PyParallelPreProc)' != 'True'"
Command=
"%(PyQstrSourceFilesToPreProc.Command)"
/>
<ParallelCustomBuild
Condition=
"'$(PyParallelPreProc)' == 'True' And '@(PyQstrSourceFilesToPreProc)' != ''"
Sources=
"@(PyQstrSourceFilesToPreProc)"
/>
<MakeDir
Directories=
"@(PyQstrSourceFiles->'%(OutDir)')"
/>
<Exec
Command=
"$(PyClTool) /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /Fi%(PyQstrSourceFiles.OutFile) /P %(PyQstrSourceFiles.Identity)"
Condition=
"'%(PyQstrSourceFiles.Changed)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"
/>
<ConcatPreProcFiles
InputFiles=
"@(PyQstrSourceFiles->'%(OutFile)')"
OutputFile=
"$(DestDir)qstr.i.last"
Condition=
"'$(RunPreProcConcat)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"
/>
<Exec
Command=
"$(PyPython) $(PySrcDir)makeqstrdefs.py split qstr $(DestDir)qstr.i.last $(DestDir)qstr _"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment