mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-40528: Improve AST generation script to do builds simultaneously (GH-19968)
- Switch from getopt to argparse. - Removed the limitation of not being able to produce both C and H simultaneously. This will make it run faster since it parses the asdl definition once and uses the generated tree to generate both the header and the C source.
This commit is contained in:
parent
7b7a21bc4f
commit
63b8e0cba3
3 changed files with 80 additions and 99 deletions
|
@ -176,20 +176,15 @@
|
|||
<Warning Text="Pegen updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedParse)' != ''" />
|
||||
</Target>
|
||||
<Target Name="_RegenAST_H" AfterTargets="_RegenGrammar">
|
||||
<!-- Regenerate Include/Python-ast.h using Parser/asdl_c.py -h -->
|
||||
<Exec Command=""$(PythonExe)" "$(PySourcePath)Parser\asdl_c.py" -h "$(IntDir)Python-ast.h" "$(PySourcePath)Parser\Python.asdl"" />
|
||||
<!-- Regenerate Include/Python-ast.h and Python/Python-ast.c using Parser/asdl_c.py -h -->
|
||||
<Exec Command=""$(PythonExe)" "$(PySourcePath)Parser\asdl_c.py" "$(PySourcePath)Parser\Python.asdl" -H "$(IntDir)Python-ast.h" -C "$(IntDir)Python-ast.c"" />
|
||||
<Copy SourceFiles="$(IntDir)Python-ast.h" DestinationFiles="$(PySourcePath)Include\Python-ast.h">
|
||||
<Output TaskParameter="CopiedFiles" ItemName="_UpdatedH" />
|
||||
</Copy>
|
||||
<Warning Text="Python-ast.h updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedH)' != '' and '@(_UpdatedC)' != ''" />
|
||||
</Target>
|
||||
<Target Name="_RegenAST_C" AfterTargets="_RegenGrammar">
|
||||
<!-- Regenerate Python/Python-ast.c using Parser/asdl_c.py -c -->
|
||||
<Exec Command=""$(PythonExe)" "$(PySourcePath)Parser\asdl_c.py" -c "$(IntDir)Python-ast.c" "$(PySourcePath)Parser\Python.asdl"" />
|
||||
<Copy SourceFiles="$(IntDir)Python-ast.c" DestinationFiles="$(PySourcePath)Python\Python-ast.c">
|
||||
<Output TaskParameter="CopiedFiles" ItemName="_UpdatedH" />
|
||||
<Output TaskParameter="CopiedFiles" ItemName="_UpdatedC" />
|
||||
</Copy>
|
||||
<Warning Text="Python-ast.c updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedH)' != '' and '@(_UpdatedC)' != ''" />
|
||||
<Warning Text="ASDL is updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedH)' != '' and '@(_UpdatedC)' != ''" />
|
||||
</Target>
|
||||
<Target Name="_RegenOpcodes" AfterTargets="_RegenAST_C">
|
||||
<!-- Regenerate Include/opcode.h from Lib/opcode.py using Tools/scripts/generate_opcode_h.py-->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue