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.
This commit is contained in:
Anthony Shaw 2020-04-29 19:09:09 +10:00 committed by GitHub
parent bfb1cf4465
commit 9b64ef3ac7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -168,7 +168,8 @@
</Target> </Target>
<Target Name="_RegenPegen" BeforeTargets="Build"> <Target Name="_RegenPegen" BeforeTargets="Build">
<!-- Regenerate Parser/pegen/parse.c --> <!-- Regenerate Parser/pegen/parse.c -->
<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;" /> <SetEnv Name="PYTHONPATH" Prefix="true" Value="$(PySourcePath)Tools\peg_generator\" />
<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;" />
<Copy SourceFiles="$(IntDir)parse.c" DestinationFiles="$(PySourcePath)Parser\pegen\parse.c"> <Copy SourceFiles="$(IntDir)parse.c" DestinationFiles="$(PySourcePath)Parser\pegen\parse.c">
<Output TaskParameter="CopiedFiles" ItemName="_UpdatedParse" /> <Output TaskParameter="CopiedFiles" ItemName="_UpdatedParse" />
</Copy> </Copy>