@@ -431,7 +431,8 @@ def mypycify(
431431 * ,
432432 only_compile_paths : Optional [Iterable [str ]] = None ,
433433 verbose : bool = False ,
434- opt_level : str = '3' ,
434+ opt_level : str = "3" ,
435+ debug_level : str = "1" ,
435436 strip_asserts : bool = False ,
436437 multi_file : bool = False ,
437438 separate : Union [bool , List [Tuple [List [str ], Optional [str ]]]] = False ,
@@ -454,6 +455,7 @@ def mypycify(
454455 verbose: Should mypyc be more verbose. Defaults to false.
455456
456457 opt_level: The optimization level, as a string. Defaults to '3' (meaning '-O3').
458+ debug_level: The debug level, as a string. Defaults to '1' (meaning '-g1').
457459 strip_asserts: Should asserts be stripped from the generated code.
458460
459461 multi_file: Should each Python module be compiled into its own C source file.
@@ -511,7 +513,9 @@ def mypycify(
511513 cflags : List [str ] = []
512514 if compiler .compiler_type == 'unix' :
513515 cflags += [
514- '-O{}' .format (opt_level ), '-Werror' , '-Wno-unused-function' , '-Wno-unused-label' ,
516+ '-O{}' .format (opt_level ),
517+ '-g{}' .format (debug_level ),
518+ '-Werror' , '-Wno-unused-function' , '-Wno-unused-label' ,
515519 '-Wno-unreachable-code' , '-Wno-unused-variable' ,
516520 '-Wno-unused-command-line-argument' , '-Wno-unknown-warning-option' ,
517521 ]
0 commit comments