Skip to content

Commit 9b64ef3

Browse files
authored
bpo-40432 Fix MSBuild project for Pegen grammars (#GH-9785)
* Update the source path of the pegen target within the Windows regen project. Change the path to Windows path formats. * Use the more reliable SetEnv task for Cpp Projects in MSBuild.
1 parent bfb1cf4 commit 9b64ef3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PCbuild/regen.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@
168168
</Target>
169169
<Target Name="_RegenPegen" BeforeTargets="Build">
170170
<!-- Regenerate Parser/pegen/parse.c -->
171-
<Exec Command="&quot;$PYTHONPATH=$(srcdir)/Tools/peg_generator&quot; &quot;$(PythonExe)&quot; -m pegen -q c &quot;$(PySourcePath)Grammar\python.gram&quot; &quot;$(PySourcePath)Grammar\Tokens&quot; -o &quot;$(IntDir)parse.c&quot;" />
171+
<SetEnv Name="PYTHONPATH" Prefix="true" Value="$(PySourcePath)Tools\peg_generator\" />
172+
<Exec Command="&quot;$(PythonExe)&quot; -m pegen -q c &quot;$(PySourcePath)Grammar\python.gram&quot; &quot;$(PySourcePath)Grammar\Tokens&quot; -o &quot;$(IntDir)parse.c&quot;" />
172173
<Copy SourceFiles="$(IntDir)parse.c" DestinationFiles="$(PySourcePath)Parser\pegen\parse.c">
173174
<Output TaskParameter="CopiedFiles" ItemName="_UpdatedParse" />
174175
</Copy>

0 commit comments

Comments
 (0)