Skip to content

Commit ab4a861

Browse files
stinosdpgeorge
authored andcommitted
msvc: Workaround parser bug in older MSBuild versions
Versions prior to v14.0 have a bug in parsing item functions when used within a condition: dotnet/msbuild#368. Since commit [db9c2e3] this results in an error when building MicroPython with for example VS2013. Fix this by creating an intermediate property.
1 parent 5b57ae9 commit ab4a861

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

windows/msvc/genhdr.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
6969
</ItemGroup>
7070
<PropertyGroup>
7171
<ForceQstrRebuild>@(QstrDependencies->AnyHaveMetadataValue('Changed', 'True'))</ForceQstrRebuild>
72+
<RunPreProcConcat>@(PyQstrSourceFiles->AnyHaveMetadataValue('Changed', 'True'))</RunPreProcConcat>
7273
</PropertyGroup>
7374

7475
<MakeDir Directories="@(PyQstrSourceFiles->'%(OutDir)')"/>
7576
<Exec Command="cl /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /Fi%(PyQstrSourceFiles.OutFile) /P %(PyQstrSourceFiles.Identity)"
7677
Condition="'%(PyQstrSourceFiles.Changed)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"/>
7778
<ConcatPreProcFiles InputFiles="@(PyQstrSourceFiles->'%(OutFile)')" OutputFile="$(DestDir)qstr.i.last"
78-
Condition="@(PyQstrSourceFiles->AnyHaveMetadataValue('Changed', 'True')) Or '$(ForceQstrRebuild)' == 'True'"/>
79+
Condition="'$(RunPreProcConcat)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"/>
7980
<Exec Command="$(PyPython) $(PySrcDir)makeqstrdefs.py split $(DestDir)qstr.i.last $(DestDir)qstr $(QstrDefsCollected)"/>
8081
<Exec Command="$(PyPython) $(PySrcDir)makeqstrdefs.py cat $(DestDir)qstr.i.last $(DestDir)qstr $(QstrDefsCollected)"/>
8182
</Target>

0 commit comments

Comments
 (0)