Skip to content

Commit

Permalink
silenced annoying -Wstrict-prototypes warning
Browse files Browse the repository at this point in the history
  • Loading branch information
edyoung committed Jun 7, 2015
1 parent e297725 commit 426676c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
build_version = os.environ.get("BUILD_PYTHON_VERSION")
build_python = os.environ.get("BUILD_PYTHON")

# by default python uses all the args which were used to compile it. But Python is C and some
# extension files are C++, resulting in annoying '-Wstrict-prototypes is not supported' messages.
# tweak the cflags to override
os.environ["CFLAGS"]= distutils.sysconfig.get_config_var("CFLAGS").replace("-Wstrict-prototypes","")
os.environ["OPT"]= distutils.sysconfig.get_config_var("OPT").replace("-Wstrict-prototypes","")

if build_version and build_python and sys.version[:3] != build_version:
print sys.version[:3], build_version
args = ["/usr/bin/python"] + sys.argv
Expand Down Expand Up @@ -129,7 +135,7 @@ def call_package_config(package,option,optional=False):
'stdc++', 'gmp'
] + jpg_libs,
extra_compile_args = [
'-Wall', '-Wno-strict-prototypes'
'-Wall',
] + png_flags,
extra_link_args = png_libs,
define_macros = defines + [('USE_GMP',1)] + extra_macros,
Expand Down

0 comments on commit 426676c

Please sign in to comment.