@@ -43,8 +43,13 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
4343 </Task >
4444 </UsingTask >
4545
46+ <!-- If any of these changed we'll force all qstrs to be generated again-->
47+ <ItemGroup >
48+ <QstrDependencies Include =" $(PyWinDir)mpconfigport.h;$(PySrcDir)mpconfig.h;$(PySrcDir)makeqstrdata.py" />
49+ </ItemGroup >
50+
4651 <!-- Preprocess changed files, concatenate and feed into makeqstrdefs.py split/cat-->
47- <Target Name =" MakeQstrDefs" DependsOnTargets =" MakeDestDir" Inputs =" @(ClCompile)" Outputs =" $(QstrDefsCollected)" >
52+ <Target Name =" MakeQstrDefs" DependsOnTargets =" MakeDestDir" Inputs =" @(ClCompile);@(QstrDependencies) " Outputs =" $(QstrDefsCollected)" >
4853 <ItemGroup >
4954 <PyIncDirs Include =" $(PyIncDirs)" />
5055 <PreProcDefs Include =" %(ClCompile.PreProcessorDefinitions);NO_QSTR;N_X64;N_X86;N_THUMB;N_ARM" />
@@ -56,15 +61,21 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
5661 <OutDir >$([System.IO.Path]::GetDirectoryName('%(OutFile)'))</OutDir >
5762 </PyQstrSourceFiles >
5863 <PyQstrSourceFiles >
59- <Changed > $([System.DateTime]::Compare($([System.IO.File]::GetLastWriteTime('%(FullPath)')), $([System.IO.File]::GetLastWriteTime('%(OutFile)'))))</Changed >
64+ <Changed Condition = " $([System.DateTime]::Compare($([System.IO.File]::GetLastWriteTime('%(FullPath)')), $([System.IO.File]::GetLastWriteTime('%(OutFile)')))) > 0 " >True </Changed >
6065 </PyQstrSourceFiles >
66+ <QstrDependencies >
67+ <Changed Condition =" $([System.DateTime]::Compare($([System.IO.File]::GetLastWriteTime('%(FullPath)')), $([System.IO.File]::GetLastWriteTime('$(DestDir)qstr.i.last')))) > 0" >True</Changed >
68+ </QstrDependencies >
6169 </ItemGroup >
70+ <PropertyGroup >
71+ <ForceQstrRebuild >@(QstrDependencies->AnyHaveMetadataValue('Changed', 'True'))</ForceQstrRebuild >
72+ </PropertyGroup >
6273
6374 <MakeDir Directories =" @(PyQstrSourceFiles->'%(OutDir)')" />
6475 <Exec Command =" cl /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /Fi%(PyQstrSourceFiles.OutFile) /P %(PyQstrSourceFiles.Identity)"
65- Condition =" %(PyQstrSourceFiles.Changed) > 0 " />
76+ Condition =" ' %(PyQstrSourceFiles.Changed)' == 'True' Or '$(ForceQstrRebuild)' == 'True' " />
6677 <ConcatPreProcFiles InputFiles =" @(PyQstrSourceFiles->'%(OutFile)')" OutputFile =" $(DestDir)qstr.i.last"
67- Condition =" % (PyQstrSourceFiles. Changed) > 0 " />
78+ Condition =" @ (PyQstrSourceFiles->AnyHaveMetadataValue(' Changed', 'True')) Or '$(ForceQstrRebuild)' == 'True' " />
6879 <Exec Command =" $(PyPython) $(PySrcDir)makeqstrdefs.py split $(DestDir)qstr.i.last $(DestDir)qstr $(QstrDefsCollected)" />
6980 <Exec Command =" $(PyPython) $(PySrcDir)makeqstrdefs.py cat $(DestDir)qstr.i.last $(DestDir)qstr $(QstrDefsCollected)" />
7081 </Target >
0 commit comments