I am building a C++ extension for use in Python. I am seeing this warning being generated during the compilation process - when a type:
python setup.py build
Removing -Wstrict-prototypes from the OPT environment variable has no effect. What works is to subclass build_ext
as follows:
from distutils.command.build_ext import build_ext
from distutils.sysconfig import customize_compiler
class my_build_ext(build_ext):
def build_extensions(self):
customize_compiler(self.compiler)
try:
self.compiler.compiler_so.remove("-Wstrict-prototypes")
except (AttributeError, ValueError):
pass
build_ext.build_extensions(self)
and then use my_build_ext
inside the setup
function:
setup(cmdclass = {'build_ext': my_build_ext})