Skip to content

Commit 1ea3e1f

Browse files
author
Neil
committed
Remove -Wstrict-prototypes, as not it's useful for C++ code and produces needless compile warnings
1 parent 2c92404 commit 1ea3e1f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
check_provide_pytz, check_provide_dateutil,\
4444
check_for_dvipng, check_for_ghostscript, check_for_latex, \
4545
check_for_pdftops, check_for_datetime, options, build_png, build_tri
46-
#import distutils.sysconfig
4746

4847
# jdh
4948
packages = [

setupext.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import os
4747
import re
4848
import subprocess
49+
from distutils import sysconfig
4950

5051
basedir = {
5152
'win32' : ['win32_static',],
@@ -200,6 +201,20 @@ def print_line(*args, **kwargs):
200201
pass
201202
print_status = print_message = print_raw = print_line
202203

204+
# Remove the -Wstrict-prototypesoption, is it's not valid for C++
205+
customize_compiler = sysconfig.customize_compiler
206+
def my_customize_compiler(compiler):
207+
retval = customize_compiler(compiler)
208+
try:
209+
compiler.compiler_so.remove('-Wstrict-prototypes')
210+
except (ValueError, AttributeError):
211+
pass
212+
return retval
213+
214+
sysconfig.customize_compiler = my_customize_compiler
215+
216+
217+
203218
def run_child_process(cmd):
204219
p = subprocess.Popen(cmd, shell=True,
205220
stdin=subprocess.PIPE,

0 commit comments

Comments
 (0)