From c656624a4fc638e4c0cc098dab0f59a6f8331b1c Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Fri, 5 Aug 2022 05:49:39 -0400 Subject: [0.29] implement the --depfile command-line option for the "cython" tool (GH-4949) Backports https://github.com/cython/cython/pull/4916 --- Cython/Compiler/Main.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Cython/Compiler/Main.py') 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, -- cgit v1.2.1