@@ -413,6 +413,11 @@ def run(self):
413
413
# ----------------------------------------------------------------------
414
414
# Preparation of compiler arguments
415
415
416
+ debugging_symbols_requested = '--with-debugging-symbols' in sys .argv
417
+ if debugging_symbols_requested :
418
+ sys .argv .remove ('--with-debugging-symbols' )
419
+
420
+
416
421
if sys .byteorder == 'big' :
417
422
endian_macro = [('__BIG_ENDIAN__' , '1' )]
418
423
else :
@@ -421,10 +426,16 @@ def run(self):
421
426
422
427
if is_platform_windows ():
423
428
extra_compile_args = []
429
+ extra_link_args = []
430
+ if debugging_symbols_requested :
431
+ extra_compile_args .append ('/Z7' )
432
+ extra_link_args .append ('/DEBUG' )
424
433
else :
425
434
# args to ignore warnings
426
435
extra_compile_args = ['-Wno-unused-function' ]
427
-
436
+ extra_link_args = []
437
+ if debugging_symbols_requested :
438
+ extra_compile_args .append ('-g' )
428
439
429
440
# For mac, ensure extensions are built for macos 10.9 when compiling on a
430
441
# 10.9 system or above, overriding distuitls behaviour which is to target
@@ -683,7 +694,8 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
683
694
include_dirs = include ,
684
695
language = data .get ('language' , 'c' ),
685
696
define_macros = data .get ('macros' , macros ),
686
- extra_compile_args = extra_compile_args )
697
+ extra_compile_args = extra_compile_args ,
698
+ extra_link_args = extra_link_args )
687
699
688
700
extensions .append (obj )
689
701
@@ -710,6 +722,7 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
710
722
'pandas/_libs/src/datetime' ],
711
723
extra_compile_args = (['-D_GNU_SOURCE' ] +
712
724
extra_compile_args ),
725
+ extra_link_args = extra_link_args ,
713
726
define_macros = macros )
714
727
715
728
@@ -721,7 +734,9 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
721
734
_move_ext = Extension ('pandas.util._move' ,
722
735
depends = [],
723
736
sources = ['pandas/util/move.c' ],
724
- define_macros = macros )
737
+ define_macros = macros ,
738
+ extra_compile_args = extra_compile_args ,
739
+ extra_link_args = extra_link_args )
725
740
extensions .append (_move_ext )
726
741
727
742
# The build cache system does string matching below this point.
0 commit comments