File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1518,6 +1518,7 @@ class db_found(Exception): pass
1518
1518
if '--with-system-expat' in sysconfig .get_config_var ("CONFIG_ARGS" ):
1519
1519
expat_inc = []
1520
1520
define_macros = []
1521
+ extra_compile_args = []
1521
1522
expat_lib = ['expat' ]
1522
1523
expat_sources = []
1523
1524
expat_depends = []
@@ -1529,6 +1530,7 @@ class db_found(Exception): pass
1529
1530
# call XML_SetHashSalt(), expat entropy sources are not needed
1530
1531
('XML_POOR_ENTROPY' , '1' ),
1531
1532
]
1533
+ extra_compile_args = []
1532
1534
expat_lib = []
1533
1535
expat_sources = ['expat/xmlparse.c' ,
1534
1536
'expat/xmlrole.c' ,
@@ -1546,8 +1548,15 @@ class db_found(Exception): pass
1546
1548
'expat/xmltok_impl.h'
1547
1549
]
1548
1550
1551
+ cc = sysconfig .get_config_var ('CC' ).split ()[0 ]
1552
+ ret = os .system (
1553
+ '"%s" -Werror -Wimplicit-fallthrough -E -xc /dev/null >/dev/null 2>&1' % cc )
1554
+ if ret >> 8 == 0 :
1555
+ extra_compile_args .append ('-Wno-implicit-fallthrough' )
1556
+
1549
1557
exts .append (Extension ('pyexpat' ,
1550
1558
define_macros = define_macros ,
1559
+ extra_compile_args = extra_compile_args ,
1551
1560
include_dirs = expat_inc ,
1552
1561
libraries = expat_lib ,
1553
1562
sources = ['pyexpat.c' ] + expat_sources ,
You can’t perform that action at this time.
0 commit comments