@@ -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
@@ -688,7 +699,8 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
688
699
include_dirs = include ,
689
700
language = data .get ('language' , 'c' ),
690
701
define_macros = data .get ('macros' , macros ),
691
- extra_compile_args = extra_compile_args )
702
+ extra_compile_args = extra_compile_args ,
703
+ extra_link_args = extra_link_args )
692
704
693
705
extensions .append (obj )
694
706
@@ -715,6 +727,7 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
715
727
'pandas/_libs/src/datetime' ],
716
728
extra_compile_args = (['-D_GNU_SOURCE' ] +
717
729
extra_compile_args ),
730
+ extra_link_args = extra_link_args ,
718
731
define_macros = macros )
719
732
720
733
@@ -726,7 +739,9 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
726
739
_move_ext = Extension ('pandas.util._move' ,
727
740
depends = [],
728
741
sources = ['pandas/util/move.c' ],
729
- define_macros = macros )
742
+ define_macros = macros ,
743
+ extra_compile_args = extra_compile_args ,
744
+ extra_link_args = extra_link_args )
730
745
extensions .append (_move_ext )
731
746
732
747
# The build cache system does string matching below this point.
0 commit comments