summaryrefslogtreecommitdiff
path: root/Cython/Compiler/CmdLine.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2022-08-05 05:49:39 -0400
committerGitHub <noreply@github.com>2022-08-05 11:49:39 +0200
commitc656624a4fc638e4c0cc098dab0f59a6f8331b1c (patch)
tree2abb4a5d71f877be7c05e1235a30cf905fc6fcae /Cython/Compiler/CmdLine.py
parent189f6684474b9d3c5e27696f2ed961657b951204 (diff)
downloadcython-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/CmdLine.py')
-rw-r--r--Cython/Compiler/CmdLine.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Cython/Compiler/CmdLine.py b/Cython/Compiler/CmdLine.py
index 9e2f8beb0..470fe6bd4 100644
--- a/Cython/Compiler/CmdLine.py
+++ b/Cython/Compiler/CmdLine.py
@@ -53,6 +53,7 @@ Options:
--module-name Fully qualified module name. If not given, it is deduced from the
import path if source file is in a package, or equals the
filename otherwise.
+ -M, --depfile Produce depfiles for the sources
"""
@@ -66,7 +67,6 @@ def bad_usage():
sys.stderr.write(usage)
sys.exit(1)
-
def parse_command_line(args):
from .Main import CompilationOptions, default_options
@@ -195,6 +195,8 @@ def parse_command_line(args):
sys.exit(1)
elif option == "--module-name":
options.module_name = pop_value()
+ elif option in ('-M', '--depfile'):
+ options.depfile = True
elif option.startswith('--debug'):
option = option[2:].replace('-', '_')
from . import DebugFlags
@@ -236,4 +238,3 @@ def parse_command_line(args):
"cython: Only one source file allowed when using --module-name\n")
sys.exit(1)
return options, sources
-