diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2022-08-05 05:49:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 11:49:39 +0200 |
commit | c656624a4fc638e4c0cc098dab0f59a6f8331b1c (patch) | |
tree | 2abb4a5d71f877be7c05e1235a30cf905fc6fcae /Cython/Compiler/Main.py | |
parent | 189f6684474b9d3c5e27696f2ed961657b951204 (diff) | |
download | cython-c656624a4fc638e4c0cc098dab0f59a6f8331b1c.tar.gz |
[0.29] implement the --depfile command-line option for the "cython" tool (GH-4949)release
Backports https://github.com/cython/cython/pull/4916
Diffstat (limited to 'Cython/Compiler/Main.py')
-rw-r--r-- | Cython/Compiler/Main.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 128441da6..9c57452ba 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -514,6 +514,10 @@ def run_pipeline(source, options, full_module_name=None, context=None): context.setup_errors(options, result) err, enddata = Pipeline.run_pipeline(pipeline, source) context.teardown_errors(err, options, result) + if options.depfile: + from ..Build.Dependencies import create_dependency_tree + dependencies = create_dependency_tree(context).all_dependencies(result.main_source_file) + Utils.write_depfile(result.c_file, result.main_source_file, dependencies) return result @@ -881,6 +885,7 @@ default_options = dict( errors_to_stderr = 1, cplus = 0, output_file = None, + depfile = None, annotate = None, annotate_coverage_xml = None, generate_pxi = 0, |