From a85ac96555a46c94c613438da6e9fedf132e9089 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 28 Aug 2018 20:40:48 +0200 Subject: [PATCH] Move the removal of the -Wstrict-prototypes flag to setup.py. It's much simpler to do it there... --- setup.py | 6 +++++- setupext.py | 15 --------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/setup.py b/setup.py index 6eab9b6b88fd..80e0e5fe7938 100644 --- a/setup.py +++ b/setup.py @@ -109,9 +109,13 @@ def __init__(self, dist): class BuildExtraLibraries(BuildExtCommand): def run(self): + # Remove the -Wstrict-prototypes option, it's not valid for C++. + try: + self.compiler.compiler_so.remove('-Wstrict-prototypes') + except (ValueError, AttributeError): + pass for package in good_packages: package.do_custom_build() - return BuildExtCommand.run(self) diff --git a/setupext.py b/setupext.py index 5644bae9dab5..11882dcf3adf 100644 --- a/setupext.py +++ b/setupext.py @@ -203,21 +203,6 @@ def print_line(*args, **kwargs): print_status = print_message = print_raw = print_line -# Remove the -Wstrict-prototypes option, is it's not valid for C++ -customize_compiler = distutils.command.build_ext.customize_compiler - - -def my_customize_compiler(compiler): - retval = customize_compiler(compiler) - try: - compiler.compiler_so.remove('-Wstrict-prototypes') - except (ValueError, AttributeError): - pass - return retval - -distutils.command.build_ext.customize_compiler = my_customize_compiler - - def make_extension(name, files, *args, **kwargs): """ Make a new extension. Automatically sets include_dirs and