Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a85ac96

Browse files
committed
Move the removal of the -Wstrict-prototypes flag to setup.py.
It's much simpler to do it there...
1 parent 32ad86f commit a85ac96

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,13 @@ def __init__(self, dist):
109109

110110
class BuildExtraLibraries(BuildExtCommand):
111111
def run(self):
112+
# Remove the -Wstrict-prototypes option, it's not valid for C++.
113+
try:
114+
self.compiler.compiler_so.remove('-Wstrict-prototypes')
115+
except (ValueError, AttributeError):
116+
pass
112117
for package in good_packages:
113118
package.do_custom_build()
114-
115119
return BuildExtCommand.run(self)
116120

117121

setupext.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,21 +203,6 @@ def print_line(*args, **kwargs):
203203
print_status = print_message = print_raw = print_line
204204

205205

206-
# Remove the -Wstrict-prototypes option, is it's not valid for C++
207-
customize_compiler = distutils.command.build_ext.customize_compiler
208-
209-
210-
def my_customize_compiler(compiler):
211-
retval = customize_compiler(compiler)
212-
try:
213-
compiler.compiler_so.remove('-Wstrict-prototypes')
214-
except (ValueError, AttributeError):
215-
pass
216-
return retval
217-
218-
distutils.command.build_ext.customize_compiler = my_customize_compiler
219-
220-
221206
def make_extension(name, files, *args, **kwargs):
222207
"""
223208
Make a new extension. Automatically sets include_dirs and

0 commit comments

Comments
 (0)