]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40432 Fix MSBuild project for Pegen grammars (#GH-9785)
authorAnthony Shaw <anthony.p.shaw@gmail.com>
Wed, 29 Apr 2020 09:09:09 +0000 (19:09 +1000)
committerGitHub <noreply@github.com>
Wed, 29 Apr 2020 09:09:09 +0000 (10:09 +0100)
* 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.

PCbuild/regen.vcxproj

index 285a8a1b9e49cf6fab6d19818b203af6de49893f..c97536f7dd96d3dc2ee40d2cea5b1f265570a94a 100644 (file)
   </Target>
   <Target Name="_RegenPegen" BeforeTargets="Build">
     <!-- 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">
       <Output TaskParameter="CopiedFiles" ItemName="_UpdatedParse" />
     </Copy>